Skip navigation
JohnsonCT
Currently Being Moderated

How does Photoshop convert 16 bit RGB values to 15 bit and 8 bit?

Feb 16, 2010 3:20 PM

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.

  • Currently Being Moderated
    Community Member
    Feb 16, 2010 4:45 PM

    Dithering on or off?

    |
    Mark as:
  • Currently Being Moderated
    Adobe Employee
    Feb 16, 2010 5:10 PM

    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.

    |
    Mark as:
  • Currently Being Moderated
    Adobe Employee
    Feb 16, 2010 5:11 PM

    Oh, and dividing by 256 is a common graphics newbie mistake.

     

    The ranges are 65535 and 255, not 65536 and 256.

    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points