why PNG is so slow?

I have a very simple tile scrolling engine. I read the tiles from a JPG file. The speed is very good. Today I decided that I will only use PNG format in my games… then I converted my JPG to a PNG file with Gimp.

For my surprise my engine got very slow! I’m loading the image file with ImageIO and puting it on a java,awt,Image objetct.

Is there a way to still have the same speed as I had before with my old jpg file?

Tks!

then I converted my JPG to a PNG file with Gimp.

That doesn’t make any sense. JPG is lossy… so once it’s jpegged the image contains lots of errors which in turn make the image bigger if it’s lossless compressed (compared to lossless compression of the original image data).

Using jpg is a one way thing.

The reason why you see different performance is most likely, because your pngs are 32bit instead of 24bit.

that was exactly the problem… I was using true color 32bit…I’ve changed to 256 colors and now it is just fine! Tks :smiley:

;)That’s it!