All my game textures start in JPG. I've been converting them to PNG for my android game, since from what I've read that seems to be the default format recommended, but I haven't seen any justification on this over JPG when the original file is JPG. I know the difference between JPG and PNG (lossy vs lossless), and that a PNG converted from a JPG can't be of higher quality than the original JPG, but the file size increases significantly in the conversion anyway. I have been doing it just in case the PNG files process faster in my game or display better on the phone screen. Would either of these be the case or should I just be leaving everything in the original JPG to save memory and time.
-
The nice thing about PNG is that it's identical to what you started with - not better, not worse. (Unless you quantize to 8-bit PNG, then it might be worse). Try the JPEG and see if it works for you. – Mark Ransom Aug 10 '13 at 15:30
-
see http://stackoverflow.com/questions/2336522/png-vs-gif-vs-jpeg-when-best-to-use/7752936#7752936 – Alex Shesterov Aug 10 '13 at 15:31
-
Once they're in JPEG, the data is already lost. If you have a 2-gallon bucket of water, you can pour it into a 5-gallon bucket, but that won't make it 5 gallons of water. – Lee Daniel Crocker Aug 10 '13 at 20:25
2 Answers
It is too late, you've already lost the fidelity. PNG cannot make lost pixels re-appear, that only works in the Law & Order crime lab. You also are quite liable to get a PNG that's larger than necessary due to the quantization noise, added when the JPEG data is converted back to a bitmap. You'll need your original artwork and skip the JPEG encoding step to go straight to PNG. It will never be a smaller file, just better.

- 922,412
- 146
- 1,693
- 2,536
-
free textures on the web are almost universally jpeg, i'll never get the original in a different format. I was curious about why there is such a huge increase in file size in the jpeg to png conversion, the png files are 2 to 3 times larger when I convert from jpeg in paint.net!, thanks for the quantization noise comment, will have to look into that. I was mainly wondering if the android system processed png's faster than jpeg's in games or if it png's had android display advantages over jpeg's, for now i'll assume it doesn't and likely bring most of my textures back to jpeg format. – Androidcoder Aug 10 '13 at 18:41
Since you are starting with a JPG, going to a PNG isn't really buying you anything. You are going from a low fidelity image to a higher fidelity image. But it can't be MORE clear than your original image. Think about watching non HD video on an HD TV. The picture isn't any better, even though the format supports better quality.
Here's a handy comparison. http://www.labnol.org/software/tutorials/jpeg-vs-png-image-quality-or-bandwidth/5385/

- 7,067
- 2
- 22
- 39