2

I have noticed something very odd. Python's Pillow, Firefox's CanvasRenderingContext2D.drawImage(), and Photoshop CC all interpret a JPEG differently. What I mean by this is some pixels vary very slightly in color value. For example, a pixel at 183, 214 might have the color (207, 019, 036) according to Pillow, (207, 018, 036) according to Firefox's JavaScript implementation, and (207, 018, 038) according to Photoshop. They're small differences (only 5 pixels differed in the 512x512 image I tested), but they're there.

So what I'm wondering is, do JPEGs have 100% canonical raster representations? Is there an objectively "correct" raster version of every JPEG, when you follow the specification? Or is there leeway? Are there valid edge cases where values vary depending on rounding (or something similar)?

obskyr
  • 1,380
  • 1
  • 9
  • 25
  • There is leeway in the downsampling of the chroma, in the quantisation of the contained frequencies and in the generation/selection of the Huffman tables which can be generated to match the frequencies present in the image.... and probably a bunch of other stuff over my head! So, I would say there is no canonical representation. I am wrong sometimes though ;-) – Mark Setchell Sep 09 '16 at 16:01

0 Answers0