Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

For android development can I use JPG image instead of PNG image on image views?

The main purpose of this question is to know what is the best option to choose between PNG and JPG for android development considering the following scenarios

1) is it a good option to use jpg image as background? 2) Will .jpg image take more time to load compared to .png? 3) Will .jpg take more time for rendering/loading compare to .png?

I have seen big difference in image size when we are using png images.

One of my .png image size is 4.1 MBs and that same image with .jpg image format the size is reduced to 2.9MBs

Need suggestion from Experts specially.

Info: To reduce app size. i am still compressing images by using compress png and compress jpeg

Image size difference is huge. ie. 4.1 MBs png -> 2.9 MBs jpg after compressing it reduced to 654.6 KBs..

To set image as BACKGROUND i didn't found any issue...

like image 969
Bhavesh Jethani Avatar asked Dec 19 '15 10:12

Bhavesh Jethani


People also ask

What image format is best for android?

In android the best format of Image is PNG as it light compare to JPG,JPEG etc.So its easy to draw and take less time to perform the operation while using these images.

Can you use JPG in Android Studio?

You can convert existing BMP, JPG, PNG or static GIF images to WebP format using Android Studio.

Which is better to use PNG or JPG?

The general rule is to use JPGs for photographs, images that don't have a transparent background, and other memory intensive files. And to choose PNGs for graphics, files with transparent backgrounds, and other images where clarity and color vibrancy are important.

What type of image is used in Android Studio?

There are two types of bitmap images commonly used for Android apps, JPEG files and PNG files.


2 Answers

It's just a question of quality and details. Just for my opinion, for a big background resolution is better to use a JPG, if you don't need any transparency on the image, with the right compromise between quality and size of file,

PNG format is a lossless compression file format, which makes it a common choice for use on the Web. PNG is a good choice for storing line drawings, text, and iconic graphics at a small file size.

JPG format is a lossy compressed file format. This makes it useful for storing photographs at a smaller size than a BMP. JPG is a common choice for use on the Web because it is compressed. For storing line drawings, text, and iconic graphics at a smaller file size, GIF or PNG are better choices because they are lossless.

From:http://www.labnol.org/software/tutorials/jpeg-vs-png-image-quality-or-bandwidth/5385/

like image 50
Vixed Avatar answered Oct 21 '22 11:10

Vixed


The main difference is image quality. The PNG format uses a lossless compression, while JPEG uses a lossy one optimized for photos. It depends what is shown on the image if JPEG is a valid alternative. In artificially generated images of geometric figures like logos the artifacts coming from JPEG compression can be easily seen.

like image 34
Henry Avatar answered Oct 21 '22 10:10

Henry