Is JPG really only acceptable for use in Android?
Solution 1
This article
http://mobile.tutsplus.com/tutorials/mobile-design-tutorials/mobile-design_png-or-jpg/
is more focused on iOS development, but it seems to agree with what you suspected about JPGs being fine for non-transparent images. PNGs are lossless, so they have that advantage, which is probably why they are recommended, but if you can live with some loss in exchange for size optimization, then JPGs seem fine to me.
Solution 2
PNGs are lossless while JPEGs are lossy. I would expect PNGs to scale slightly better, but if you can live with the JPEG quality it seems appropriate/acceptable.
likebobby
Updated on June 04, 2022Comments
-
likebobby about 2 years
Android supports three image formats with this rating:
PNG (preferred), JPG (acceptable) and GIF (discouraged). Source: http://developer.android.com/guide/topics/resources/drawable-resource.html#Bitmap
Why is JPG only listed as acceptable? Isn't JPG a better format for images without transparency because they take less space than PNG:s?
Or does PNG behave so much better during runtime that it is worth storing full screen background images etc. as PNG:s even if they tend to make the APK much bigger?
I'm not very satisfied with many apps containing a lot of graphics eating the space on my Internal storage so it's getting full all the time. And my guess is that they are badly optimized in that sense by using PNG when they could use JPG because the developer guide says PNG is preferred without explaining why. Can anyone tell if I'm correct when saying JPG should be used for non-transparent images?
-
Admin over 13 yearsAlso, PNGs support transparency.
-
likebobby over 13 yearsGood article, gives me better understanding for Android as well. Hope more devs use .jpg when suitable. Large app files filling Android internal memory aren't that nice!
-
Steve-o over 13 yearsThe article is terrible in places: "Color and Contrast – The colors in the .jpg are richer, more saturated. The .png looks washed out." That has nothing to do with the format and everything to do with Photoshop export filters.
-
Steve-o over 13 yearsIt's more likely due to many designers not understanding that lossy compression for graphics, c.f. photography, looks really bad.