PNG vs JPG para mostrar imágenes [no iconos] en la aplicación de Android

Before I start my question let me put it out there that I am aware that for icons etc, png is the preferred format in Android.

  • My question is when displaying large images [pictures or photographs], what would be the preferred format? I am trying to see if I can go with jpg images as they are smaller in size.

  • I would also like to see if using jpg images for these large pictures might cause any issues that using png images will avoid. In my case I am talking about normal opaque images. [no alpha/transparency]

In most cases my images will fill the entire screen and in some cases, I will have smaller thumbnail versions of the images in a grid. A gallery of images is the closest to what I am trying to build.

I saw the other question about png vs jpg but I wanted to get some insight from Android point of view rather than any other use cases.

preguntado el 09 de septiembre de 13 a las 22:09

"Android" doesn't really matter here. It's the same as it is for any other use case, really. -

If you using Picture like landing page, should use a JPEG, because JPEG have small size. -

1 Respuestas

Esta pregunta should shed some light on that. Very helpful. A big reason most go with PNG is the alpha transparency issue. If this doesn't apply to you, you may not be as tied to it as most.

También, trabaja para este artículo goes a bit more in depth.

PNG is a newer format, and is really a good replacement for GIFs. Sadly, however, it has a few drawbacks: Firstly it cannot support animation like GIF can. Secondly it has some support issues with older browsers like IE6. Thirdly, important software like Photoshop have very poor implementation of the format. Here's what's good about it: Unlike GIFs, PNGs can either be Indexed or Direct color (like JPGs), if need be. That means that it can have nice smooth gradients, if you don't mind a larger file. PNG also supports a nifty thing called Alpha Transparency which means that you have things like smooth drop shadows, even on Indexed color images. Most of the time, an Indexed color PNG filesize will be smaller or equal to a GIF equivalent. Using the extra features (thousands of colours or alpha transparency) will increase the filesize, though. Essentially using PNG just gives you greater options and flexibility.

contestado el 23 de mayo de 17 a las 11:05

Yup transparency doesn't matter for me. So I will stick with jpg images for now. The other article was also helpful. Thank you. - lograr

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.