62
\$\begingroup\$

I prefer PNG format to JPG, because JPG uses lossy compression.

When I capture a screen in my PC or scan a picture or document in my scanner, I always save them as PNG format.
If a camera could save its data as PNG format, I'd use the feature even if I needed to buy more memory cards.

But I haven't see any camera that does. Why not? Why don't most (or any) cameras support PNG format?

P.S My camera doesn't support RAW.

\$\endgroup\$
10
  • 7
    \$\begingroup\$ Many support TIFF, which also supported lossless compression. But then the question becomes "Why don't most web browsers support TIFF?" \$\endgroup\$
    – mattdm
    Commented May 5, 2011 at 11:14
  • 3
    \$\begingroup\$ You prefer PNG to JPG for photography? I have not seen an argument for that before. \$\endgroup\$
    – dpollitt
    Commented May 5, 2011 at 13:27
  • 1
    \$\begingroup\$ Its kindof ironic that the link you give uses png as an examply of lossy compression :) \$\endgroup\$
    – Toby Allen
    Commented May 5, 2011 at 17:27
  • 6
    \$\begingroup\$ @JZL While PNG supports color palettes (indexed color), it does not require them. I'm sure we're talking about good old 24- or 48-bit RGB color here. GIF, on the other hand, only supported indexed color and was limited to 256 colors in the palette. \$\endgroup\$
    – coneslayer
    Commented May 5, 2011 at 19:45
  • 2
    \$\begingroup\$ @Pacerier Most of them. Rather than listing, check out this table on wikipedia. \$\endgroup\$
    – mattdm
    Commented Aug 19, 2015 at 23:13

7 Answers 7

66
\$\begingroup\$

The JPEG format has the advantage of giving small files. The RAW formats have the advantage of preserving all the data collected at the shot.

The PNG format gives neither of these advantages, so you don't even get a compromise between the other formats, you get almost only the drawbacks from both formats.

\$\endgroup\$
24
  • 3
    \$\begingroup\$ One point to note here, there is no "the RAW format". So if Benjamin wished for a standard, he would have to convert his RAW to DNG. \$\endgroup\$
    – Leonidas
    Commented May 5, 2011 at 14:31
  • 1
    \$\begingroup\$ Yes, RAW just means the cameras internal format, and varies from camera to camera. I recently used a camera whose raw format involved two bytes per pixel and several thousand extra header/footer bytes (ugh). \$\endgroup\$ Commented May 5, 2011 at 16:20
  • 2
    \$\begingroup\$ @John, using 2 bytes/pixel is abnormal? How else would you fit the 12 or 14-bit value the sensor provides for each pixel? You could do a little compression afterwards, but for a bunch of more-or-less random data it may not even be worth it. \$\endgroup\$
    – Nick T
    Commented May 6, 2011 at 0:22
  • 1
    \$\begingroup\$ @John Robertson: Most chips only record one color per pixel, not three, so 14 bit RAW corresponds to 42 bit RGB, after two color components per pixel has been interpolated from surrounding pixels. \$\endgroup\$
    – Guffa
    Commented May 6, 2011 at 16:48
  • 1
    \$\begingroup\$ @IulianOnofrei: Although the PNG format is lossless, a lot of data is lost before it is put in the file. The format (as used) only supports a bit depth up to 8 bits, so the 12-14 bits from the sensor has to be reduced to 8 in the same way as for JPEG. The JPEG compression removes some more data, but if you compare JPEG images to PNG images (overlaying by subtraction) you see that the differences are very small, and doesn't really warrant the larger file size. \$\endgroup\$
    – Guffa
    Commented Feb 23, 2020 at 18:09
52
\$\begingroup\$

Image size notes aside, a big reason is that PNG does not have a standardized means of EXIF embedding and that will immediately shy the camera makers away from it. There would be a lot of information lost by doing image conversion to PNG in camera as a result and, for the most part, would probably been seen as a negative by most photographers.

\$\endgroup\$
17
  • 8
    \$\begingroup\$ +1 Never realized that there was no standardized EXIF embedding for PNG. Good to know. \$\endgroup\$
    – coneslayer
    Commented May 5, 2011 at 13:43
  • 6
    \$\begingroup\$ Most likely reason. Metadata is nice. \$\endgroup\$
    – Leonidas
    Commented May 5, 2011 at 13:54
  • 4
    \$\begingroup\$ Wiki: iTXt contains UTF-8 text, compressed or not, with an optional language tag. iTXt chunk with the keyword 'XML:com.adobe.xmp' can contain Extensible Metadata Platform (XMP). \$\endgroup\$
    – Kevin Peno
    Commented May 5, 2011 at 15:38
  • 8
    \$\begingroup\$ Lack of EXIF data would be "seen as a negative" by photographers? Bah! These young digital photographer whipper-snappers! In my day, photographers used film and knew what a negative really looked like! :-) \$\endgroup\$ Commented May 5, 2011 at 16:25
  • 4
    \$\begingroup\$ @Oddthinking At least the negative had a little metadata at the edges! \$\endgroup\$
    – coneslayer
    Commented May 5, 2011 at 16:41
28
\$\begingroup\$

PNG may use a lossless compression algorithm, but it is lossy in comparison to the raw data. You lose bit depth, the camera may introduce demosaicing artifacts, you may bake in a bad color balance, the camera may apply inappropriate sharpening, the in-camera noise reduction may wash out detail, etc. I don't think there's a big demand for a format that's as large as raw, but less amenable to postprocessing.

\$\endgroup\$
21
  • 4
    \$\begingroup\$ The .png would almost certainly be bigger than the raw as the png would have to store three colour values per pixel instead of one raw sample, so for an 8bit png that's 24 bits per pixel vs. 12 or 14 bpp for the raw. \$\endgroup\$
    – Matt Grum
    Commented May 5, 2011 at 13:12
  • 1
    \$\begingroup\$ PNG, being lossless, however doesn't suffer from generational loss as a result of editing in the same manner that JPEG does. So, in that aspect, I don't think it's any worse than JPEG in camera. \$\endgroup\$
    – Joanne C
    Commented May 5, 2011 at 13:28
  • 3
    \$\begingroup\$ @John But it is worse than raw, which is what you should be using for editing. PNG just seems like an unhappy medium between JPEG and raw. \$\endgroup\$
    – coneslayer
    Commented May 5, 2011 at 13:31
  • 6
    \$\begingroup\$ @Matt As the PNG does use compression (too), the result does not have to be bigger at all (depends on algorithms). To put it to you in a question: if you convert an ASCII-file (8 bit per character) to a UTF16-file, should a compressed result become significantly bigger? If you answer that with "yes", please re-read compression-algorithms. \$\endgroup\$
    – Leonidas
    Commented May 5, 2011 at 13:42
  • 3
    \$\begingroup\$ @coneslayer I guess that Benjanmin has the same problem I had/have when reworking pictures: (1) JPG already lost some picture data and (2a) RAW is proprietary (software only available now for some time), (2b) not every camera offers RAW. Several years ago I too desperately wished for TIFF or PNG in my compact. \$\endgroup\$
    – Leonidas
    Commented May 5, 2011 at 13:59
9
\$\begingroup\$

PNG is portable network graphics. It is targetted for the web, and rather simple (in colors) images. Its compression is very ineffective for realistic graphics as you will shoot with a camera, so the results are nearly uncompressed. As such you can then simply use RAW files, which do add the benefit, that there is no lossy conversion to an RGB colorspace.

The reason JPEG is used is simply that its compression is very good and works very well with more realistic graphics where individual artifacts are invisible to the human eye. In addition JPEG is supported by nearly any device and offers many way to add additional metadata, including color profiles.

No single RGB file format is able to store the image exactly as the camera sensor sees it; there is always some kind of loss in that conversion. As such it makes sense to use a format that has good compression which doesn't really harm the picture in total. If you are looking for a real lossless format, the camera's RAW is the only direction you can go, from which you then can create whatever file you desire.

\$\endgroup\$
6
  • \$\begingroup\$ Lossy conversion to the RGB colourspace? How so? What do you exactly loose while converting Bayer-sensor-data (additive data) to one form of the RGB-versions? (Btw: PNG does offer ICC-profiles in principle too, FF plans to support it, I read.) \$\endgroup\$
    – Leonidas
    Commented May 5, 2011 at 16:46
  • \$\begingroup\$ @Leonidas: There is no “the” RGB colorspace. The camera collects much more information than what is interpretable by any RGB colorspace (sRGB, Adobe RGB etc.). As such when the conversion is done to an RGB file, there is always some information/colors lost. The only way to preserve that is by saving the data the way the camera sees it, i.e. the RAW. \$\endgroup\$
    – poke
    Commented May 5, 2011 at 16:50
  • \$\begingroup\$ @poke Can you explain how a typical RGGB-sensor produces data which can't be converted lossless in any RGB-format? (I'm aware that there are multiple, note "one form of the RGB-versions".) \$\endgroup\$
    – Leonidas
    Commented May 5, 2011 at 17:02
  • \$\begingroup\$ @Leonidas: I can be wrong with it, and if you know better (or are tricking me to say something wrong here), please correct me, but given that the sensor doesn't separate the light it sees into 256 steps for each color, I don't think that any normal RGB file format or RGB colorspace is able to contain all that information. I'm aware that the sensor does capture the data as RGB information, so in theory there could be a RGB colorspace if there was one that could hold as much information as the image actually contains. \$\endgroup\$
    – poke
    Commented May 5, 2011 at 17:27
  • \$\begingroup\$ @poke No trick here, I just seriously doubt that there won't be any RGB format offering the gamut of the sensor. Concerning the discrimination - I think that 16 bit/channel-formats offer enough room to receive it. For example in photo.stackexchange.com/questions/8707/raw-processing-software/… jrista mentions a demosaicing called Bayer Drizzle that really seems to be engineered to keep any data available. \$\endgroup\$
    – Leonidas
    Commented May 5, 2011 at 17:35
4
\$\begingroup\$

Shoot RAW, develop to a PNG file (if the software allows).

http://www.luminous-landscape.com/tutorials/understanding-series/u-raw-files.shtml

\$\endgroup\$
2
\$\begingroup\$

Both formats have their Pros and Cons.

But the real reason why JPEG is more prevalent than PNG is that the people behind JPEG do aggressive licensing, which PNG lacks. (www.libpng.org/pub/png/)

This is very similar to MP3 vs. OGG vs. FLAC. MP3 Creators licensed aggressively in the beginning... leading to the popularity. Due to this, now, manufacturers approach MP3 to get licenses!

\$\endgroup\$
2
  • \$\begingroup\$ MP3 no longer requires a license, the patents expired a while ago. I think Fraunhofer shut down their licensing operation. Of course I should have noticed that you wrote this answer before any of that was true. \$\endgroup\$ Commented Feb 8 at 0:29
  • \$\begingroup\$ @MarkRansom, you're right... now! But doesn't matter as this is far from the best/most-upvoted answer here anyway :) Thanks for checking out my answer! \$\endgroup\$ Commented Feb 20 at 7:57
0
\$\begingroup\$

IMO you should always shoot in RAW, if you are not worried about memory costs RAW is the way to go. This gives you the best opportunity to correct images in post processing.

Below is a quote from: http://www.hackerfactor.com/blog/index.php?/archives/252-PNG-and-Cameras.html

PNG is absolutely wonderful for storing true 24-bit color images. Processing PNG files is very simple and requires no application-specific fields. However, it is computationally expensive, lacks the ability to store multiple images, and does not have many standardized text fields for managing meta data.

JPEG is a wasteful file format filled with specialized fields. It is also a poor choice for true color representation. However, it is computationally inexpensive, supports multiple image storage, and scaling images is trivial. And sadly, it widely accepted as the de facto standard.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.