[SOLVED]Problem with GIMP's PNG

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
weeix
Posts: 23
Joined: Fri Jul 09, 2010 5:07 am

[SOLVED]Problem with GIMP's PNG

Post by weeix »

I used GIMP 2.6.8 to export my logo (initially from Inkscape 0.47) into a *.png file. When I open it via an image viewer, it's fine, but when I use it in the game, the resolution just dropped. I tried to configure every PNG's settings, but none seems to work.

This is my original PNG:
Image

But when I put it in my game, it appears like this:
Image

Here is my code:

Code: Select all

gui::IGUIImage* gprogLogo = env->addImage(
	driver->getTexture("Resources/GprogLogo.png"),core::vector2d<s32>(446,10));
Help me please :cry:

EDIT: Problem solved by using width/height that is a power of two, e.g., 1, 2, 4, 8, 16, 32, 64, 128, etc.
Last edited by weeix on Sat Sep 04, 2010 2:39 pm, edited 1 time in total.
Jake-GR
Posts: 41
Joined: Wed Jan 07, 2009 12:32 am
Location: Colorado
Contact:

Post by Jake-GR »

not for sure it will help? but a friend recently had an issue with exporting png's from gimp as well (looked similar to yours)
fix was to change Image->Mode from RGB to Indexed (in gimp) before saving as png
weeix
Posts: 23
Joined: Fri Jul 09, 2010 5:07 am

Post by weeix »

It doesn't work. The resolution is still the same.

Anyhow, thank you!
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Post by REDDemon »

there is no problem with your logo. i can see it pretty well in irrlicht helloworld,i replaced the irrlicht logo with this one

are you running the app with a 8 bit color depth?

if there is any problem is related to your machine or to your code.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
weeix
Posts: 23
Joined: Fri Jul 09, 2010 5:07 am

Post by weeix »

Unfortunately, not for me.

Image

After that, I replaced my "irrlichtlogo2.png" with the original one, and..

Image

By the way, I don't see any logo in HelloWorld Tutorial. Which Irrlicht version did you use?
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Post by REDDemon »

I use Irrlicht 1.7.1. try different compression level on your png. the default is 9 and on me work correctly.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

Try ensuring the width and height are powers of two. Some graphics cards require it.

e.g. put it in a canvas of 256x128, with the unused area as transparent.
kazymjir
Posts: 727
Joined: Sat Feb 20, 2010 4:05 pm
Location: Munich, Bayern

Post by kazymjir »

xDan wrote:Try ensuring the width and height are powers of two. Some graphics cards require it.

e.g. put it in a canvas of 256x128, with the unused area as transparent.
Yes, you should try this sholution.
Check this thread:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=39752
weeix
Posts: 23
Joined: Fri Jul 09, 2010 5:07 am

Post by weeix »

I'm using Mobile Intel® 945E Chipset, so POT solves my problem too.

Thank you everyone! :wink:

In addition, I found that numbers like 96 or 192 are also available too. I don't know why, but it works.
Post Reply