SFML community forums

Help => Graphics => Topic started by: C++Geek on May 15, 2015, 07:32:51 pm

Title: Transparent Image Help
Post by: C++Geek on May 15, 2015, 07:32:51 pm
Hello!

I would like to use SFML to display a partially transparent PNG image.
The one called "shape.png" works fine.
The one called "arrow.png" fails to load.

What is wrong with arrow.png?
Title: Re: Transparent Image Help
Post by: shadowmouse on May 15, 2015, 07:39:06 pm
Is there an error message?
Title: Re: Transparent Image Help
Post by: AFS on May 15, 2015, 08:11:06 pm
"arrow.png" is an 8 bit PNG, which are not supported. Transform it to 24 bit and it should work.

Here's a transformed version:
Title: Re: Transparent Image Help
Post by: C++Geek on May 15, 2015, 08:41:07 pm
Quote
Here's a transformed version:

How did you do that?
Title: Re: Transparent Image Help
Post by: AFS on May 15, 2015, 08:51:37 pm
Using GIMP, I changed the color mode from Indexed to RGB :)

Does it load now?
Title: Re: Transparent Image Help
Post by: Jesper Juhl on May 15, 2015, 08:53:58 pm
ImageMagic (http://www.imagemagick.org/) is also a great tool for transforming images in every-which-way you could dream of (including changing formats easily). Check it out.
Title: Re: Transparent Image Help
Post by: C++Geek on May 15, 2015, 09:41:10 pm
Quote
Does it load now?

Yes it does. Thanks!