Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Transparent Image Help  (Read 2415 times)

0 Members and 1 Guest are viewing this topic.

C++Geek

  • Newbie
  • *
  • Posts: 11
    • View Profile
Transparent Image Help
« 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?

shadowmouse

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
Re: Transparent Image Help
« Reply #1 on: May 15, 2015, 07:39:06 pm »
Is there an error message?

AFS

  • Full Member
  • ***
  • Posts: 115
    • View Profile
Re: Transparent Image Help
« Reply #2 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:

C++Geek

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Transparent Image Help
« Reply #3 on: May 15, 2015, 08:41:07 pm »
Quote
Here's a transformed version:

How did you do that?

AFS

  • Full Member
  • ***
  • Posts: 115
    • View Profile
Re: Transparent Image Help
« Reply #4 on: May 15, 2015, 08:51:37 pm »
Using GIMP, I changed the color mode from Indexed to RGB :)

Does it load now?

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Transparent Image Help
« Reply #5 on: May 15, 2015, 08:53:58 pm »
ImageMagic is also a great tool for transforming images in every-which-way you could dream of (including changing formats easily). Check it out.

C++Geek

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Transparent Image Help
« Reply #6 on: May 15, 2015, 09:41:10 pm »
Quote
Does it load now?

Yes it does. Thanks!