62

I'm building an app that uses a lot of images, so it's getting pretty big. I got more than 15mb in PNG images, and if I convert those images to JPG I would get 5MB or less! So, why should I use PNG instead of JPG?

I know that PNGs are preferred, but what would I lose with JPG?

EDIT: Thank you everybody!

Just a note: Since I got my answer and turns out that I will need to use PNG in most files, I found out that website http://tinypng.org/ , and that's helping me a lot. My 15mb of images are now 7mb. So, if anyone is in the same situation that I am, I hope that it helps!

Parag Meshram
  • 7,580
  • 8
  • 47
  • 86
Victor Santiago
  • 892
  • 1
  • 10
  • 20
  • 5
    JPG doesn't support transparency, but PNG does. I chose PNG for that reason. – Ta Duy Anh Oct 18 '12 at 04:05
  • 2
    IIRC, PNG scales better, but don't take my word for it. If they make such a difference, chances are you're using a lot of photos, which are ideal for JPG. If I were in your situation, I'd try out the JPGs and see if they look good on a mid/low end phone. 10MB is fairly big for a casual app. – Muz Oct 18 '12 at 04:10
  • 1
    You could tile some of the images together in a bigger file to reduce overhead from the image format, and read parts of the images selectively. I think this method is used for games. – James Oct 18 '12 at 10:39
  • LOL, classic stackoverflow. "The question already has an answer here:", links to a question that is closed... – Dick Lucas Jul 28 '15 at 16:05

2 Answers2

49

Major reason - PNG will give you advantage of Alpha Transparency over JPG.

Also see: PNG vs. GIF vs. JPEG vs. SVG - When best to use?

Community
  • 1
  • 1
Parag Meshram
  • 7,580
  • 8
  • 47
  • 86
  • 3
    "important software like Photoshop have very poor implementation of the format" Some details or references about that? – leonbloy Oct 18 '12 at 13:47
  • 2
    @leonbloy: See: http://graphicdesign.stackexchange.com/questions/5888 – Adrian Pronk Oct 24 '12 at 07:02
  • 1
    @leonbloy [Photoshop doesn't support Index+Alpha](http://calendar.perfplanet.com/2010/png-that-works/) combination that gives [smallest files *with alpha*](http://pngmini.com). – Kornel Mar 03 '13 at 22:54
14

PNGs are smaller for images a few solid colors (solid polygons) (because they make JPEG artifacts more obvious) JPEGs are better for photos and other images that don't have consistent patterns (JPEG artifacts are harder to notice here)

Hayk Saakian
  • 1,936
  • 2
  • 17
  • 30