# Is .png photo format lossless?

**URL:** <https://boards.straightdope.com/t/is-png-photo-format-lossless/363644>\
**Category:** Factual Questions\
**Created:** [July 8, 2006, 5:21pm UTC](https://boards.straightdope.com/t/is-png-photo-format-lossless/363644 "2006-07-08T17:21:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fishbicycle](https://avatars.discourse-cdn.com/v4/letter/f/aeb1de/32.png) [@fishbicycle](https://boards.straightdope.com/u/fishbicycle)\
**Post date:** [July 8, 2006, 5:21pm UTC](https://boards.straightdope.com/t/is-png-photo-format-lossless/363644/1 "2006-07-08T17:21:26Z")

</div>

I do a lot of restoration work on scanned images. They usually start as .jpg, which are already compressed. After I’ve cleaned them up, I save them as .bmp, so as not to lose any more quality. In a recent discussion on another forum, someone mentioned .png and said it was not as large as a bitmap, and clearer than a .jpg. Is there anything to this? What’s the intended use for .png? Is it lossless, or just a different compression algorithm?

---

<div class="post-metadata">

**Author:** ![chrisk](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@chrisk](https://boards.straightdope.com/u/chrisk)\
**Post date:** [July 8, 2006, 5:36pm UTC](https://boards.straightdope.com/t/is-png-photo-format-lossless/363644/2 "2006-07-08T17:36:28Z")

</div>

As far as I can tell, PNG is a lossless compresion algorithm. Like winzip or winrar on your computer files, what you get back out is exactly what you put in, but for the majority of pictures, it takes up less space than an uncompressed storage format like bitmaps.

Of course, no lossless compression algorithm can save space on every possible file format - that’d be like pulling extra kilobytes of data out of a white hole - completely impossible. However, the kinds of pictures that would take as much space, or even slightly more, in PNG format are the kinds that people are extremely unlikely to care about - bizarre patterns of colored snow, with every tiny pixelized grain a completely different shade from everything around it.

As long as you can find useful patterns in the visual data, you can use those patterns to find more compact ways of expressing the picture, without losing any level of detail.

I hope that this fits.

PS: Before I started researching it, I wondered if PNG might be sometimes-lossy, like GIF. For simple graphics like it’s meant to handle, GIF is lossless - if there are more complicated photographic details, it becomes lossy, because the pallete must be forced down to 255 shades or whatever.

---

<div class="post-metadata">

**Author:** ![threemae](https://avatars.discourse-cdn.com/v4/letter/t/5f9b8f/32.png) [@threemae](https://boards.straightdope.com/u/threemae)\
**Post date:** [July 8, 2006, 5:56pm UTC](https://boards.straightdope.com/t/is-png-photo-format-lossless/363644/3 "2006-07-08T17:56:54Z")

</div>

PNG is indeed lossless in my experience but it doesn’t compress well at all for photographs. Basically, you’re just as well off saving a photograph as a .bmp.

However, for graphics, etc., .PNG works very well and will compress losslessly to an even smaller file size than a .jpg.

---

<div class="post-metadata">

**Author:** ![Bytegeist](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@Bytegeist](https://boards.straightdope.com/u/Bytegeist)\
**Post date:** [July 8, 2006, 7:11pm UTC](https://boards.straightdope.com/t/is-png-photo-format-lossless/363644/4 "2006-07-08T19:11:43Z")

</div>

[From](http://www.libpng.org/pub/png/spec/1.2/PNG-Rationale.html#R.Why-these-features) the PNG website:

> [@](#):
>
> There is no lossy compression in PNG. Existing formats such as JFIF (JPEG File Interchange Format) already handle lossy compression well. Furthermore, available lossy compression methods, e.g., the JPEG (Joint Photographic Experts Group) algorithm, are far from foolproof — a poor choice of quality level can ruin an image. To avoid user confusion and unintentional loss of information, we feel it is best to keep lossy and lossless formats strictly separate.

---

<div class="post-metadata">

**Author:** ![fishbicycle](https://avatars.discourse-cdn.com/v4/letter/f/aeb1de/32.png) [@fishbicycle](https://boards.straightdope.com/u/fishbicycle)\
**Post date:** [July 8, 2006, 7:38pm UTC](https://boards.straightdope.com/t/is-png-photo-format-lossless/363644/5 "2006-07-08T19:38:07Z")

</div>

Thanks, everyone, for the information.

The images I’ve saved in .png so far are about 4 MB smaller than a .bmp, although larger than the original .jpg. I honestly couldn’t tell the difference between two of the same images saved to .bmp and .png. I’m not sure I’d like to use any PNG quality level lower than 10, though. I will definitely go to the website suggested by **Bytegeist** and read up on the format.

---

<div class="post-metadata">

**Author:** ![kellner](https://avatars.discourse-cdn.com/v4/letter/k/c2a13f/32.png) [@kellner](https://boards.straightdope.com/u/kellner)\
**Post date:** [July 8, 2006, 8:30pm UTC](https://boards.straightdope.com/t/is-png-photo-format-lossless/363644/6 "2006-07-08T20:30:34Z")

</div>

> [@fishbicycle](#):
>
> I honestly couldn’t tell the difference between two of the same images saved to .bmp and .png.

Unless that was a typo, how should you? Both formats are lossless. As long as you saved from the same source, they are identical pixel for pixel.

> [@](#):
>
> I’m not sure I’d like to use any PNG quality level lower than 10, though. I will definitely go to the website suggested by **Bytegeist** and read up on the format.

The level in the PNG format doesn’t indicate quality, just compression. In a lossless format this means that you can trade time spent compressing for a slight reduction in file size but the image won’t change.
