Feb 16, 2010 3:20 PM
How does Photoshop convert 16 bit RGB values to 15 bit and 8 bit?
-
Like (0)
Can someone please help me understand what rounding off scheme or other algorithm is used when Photoshop reduces a 16 bit colour to 8 bits?
As an example, the following two colours (A and B) are 16 bit swatch colours taken directly from an ACO file:
A16 = (61603, 60948, 58982)
B16 = (58326, 57015, 52428)
Photoshop displays the "16 bit" (acutally 15 bit) values as so:
A15 = (30802, 30474, 29491)
B15 = (29163, 28508, 26214)
It seems that the 15 bit values are the result of dividing by two and round to the nearest integer.
With 8 bit, it is a different story though:
A8 = (240, 237, 229)
B8 = (227, 222, 204)
Now, dividing the 16 bit value by 256 gives the following:
A8_float = (240.6, 238.1, 230.4)
B8_float = (227.8, 222.7, 204.8)
It is a similar story when dividing the 15 bit values by 128. No rounding or truncation scheme will get the same answers as Photoshop for 8 bit as far as I can see. What I can't work out is how Photoshop calculates these numbers. Is it integer division, floating point division with rounding or truncation? I'm stumped. Please help.
Dithering on or off?
65535 -> 32768 range: (32768 * x + 32767) / 65535
Not quite dividing by 2, otherwise you'd miss the white point.
32768 -> 255 range: (255 * x + 16384) / 32768
Except for dithering, it's all simple math.
Oh, and dividing by 256 is a common graphics newbie mistake.
The ranges are 65535 and 255, not 65536 and 256.
North America
Europe, Middle East and Africa
Asia Pacific
Copyright © 2011 Adobe Systems Incorporated. All rights reserved.
Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy (updated 07-14-2009).