I tried this with Adobe Photoshop Elements 9. When I have a black background, and a white brush with an opacity of 1%, the color should get brighter if I click onto the same spot over and over again. It does that, but only until the color is
#d5d5d5
. No matter how often I click onto an area with that color (or a brighter one), it won’t get any brighter. Is this just a rounding error or is it intended?Limits:
- Adobe Photoshop Elements 9 or Photoshop CS2:
#d5d5d5
- javascript with
processing.js
(rounded to ~ 1.17%):#d4d4d4
- GIMP 2.6.11:
#c0c0c0
Answer
The ceiling is indeed a rounding issue — it’s a limitation of storing pixel values as 8-bit integers.
In Photoshop CS2, using decimal values rather than hex and looking at one channel for simplicity:
The value of the pixel appears to be given by:
NewValue = RoundToInteger(
(CurrentValue * (1 - InkOpacity)) + (InkValue * InkOpacity)
)
When InkOpacity = 1%, InkValue = 255,
NewValue = RoundToInteger(
(CurrentValue * 0.99) + 2.55
)
-
For CurrentValue < 44, this gives you an increment of 3 per click
-
For CurrentValue >= 45 and < 129 this gives you an increment of 2 per click
-
For CurrentValue >= 129 and < 213 this gives you an increment of 1 per click
-
For CurrentValue >= 213, there is no increment at all.
Note that with higher bit depths, InkValue would be greater. The effect of each click still diminishes, but the ceiling would be closer to pure white.
Assuming the same formula (I haven’t tested in Photoshop yet), 16 bit channel values (for which InkValue = 65535) should eventually get you to 65486/65535 which is greater than 99.9% pure white. It’ll take you 703 clicks though!
Attribution
Source : Link , Question Author : Jake , Answer Author : e100