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)?

4

0 回答 0