Photoshop CC 2019: Apply Image, Soft Light, and the 6-years old "50% Gray in 16-bit mode" bug (+ workaround)

  • 2
  • Problem
  • Updated 2 weeks ago
  • (Edited)
This is a bug possibly connected to an unfixed 6-years old bug regarding the value for 50% gray in 16-bit mode in some Photoshop dialog boxes, see: https://feedback.photoshop.com/photoshop_family/topics/photoshop_uses_the_wrong_50_gray_as_the_neutr...

The problem:
Using Apply Image (Blending: Add, Opacity: 100%, Scale: 1, Offset: -128) on two 50% gray (RGB values of: 16384) layers in 16-bit mode produces non-50% gray layer.

Steps to reproduce (with correct 50% gray value of 16384):
  1. Create an empty document in 16-bit mode (of any size)
  2. Create an empty layer, named "A". Delete the background layer.
  3. Fill the layer "A" with 50% gray (Edit>Fill: Contents 50% Gray)
  4. Use the Info panel, read RGB values in 16-bit mode of the Info panel: 16384, in 8-bit mode: 128
  5. Duplicate the layer "A", name it "B". Make sure the layer "B" is an active layer.
  6. Image>Apply Image: Layer: A, Blending: Add, Scale: 1, Offset: -128
  7. Read the resulting value: 16320 (in 16-bit mode of the Info panel), 127 (in 8-bit mode of the Info panel)
    Expected: 16384 in 16-bit mode of the Info panel and 128 in 8-bit mode of the Info panel.

Steps to reproduce (with incorrect 50% gray value 16448)
:
  1. Create an empty document in 16-bit mode (of any size)
  2. Create an empty layer (alt-click the "new layer" icon), named "A" in the "Soft Light" mode, with checked "Fill with Soft-Light-neutral color (50% gray)". Change the mode to Normal. Delete the background layer.
  3. Use the Info panel, read RGB values in 16-bit mode of the Info panel: 16448 (different from the previous one), in 8-bit mode: 128 (the same as the previous one)
  4. Duplicate the layer "A", name it "B". Make sure the layer "B" is an active layer.
  5. Image>Apply Image: Layer: A, Blending: Add, Scale: 1, Offset: -128
  6. Read the resulting values didn't change: 16448 (in 16-bit mode of the Info panel), 128 (in 8-bit mode of the Info panel)
Possible cause:
Apply Images uses an incorrect way for converting -128 (8-bit) to a 16-bit value.
Is: convert_8bit_to_16_bit(128) -> 16448,
Should be: convert_8bit_to_16_bit(128) -> 16384.

Workaround (with some losses):
We want to calculate: for layers A and B create the layer C with pixel values of:
"50% gray" + ((A - "50% gray") + (B - "50% gray")) (clipped at 100% black and white)

1) For layers A and B, shift the correct 50% gray point (16384) to the incorrect one (16448) using the Levels adjustment (NOT the Adjustment layer!) with "input white = 254". We are loosing some data.


2) Use the Apply Image as above.

3) Convert the result to the correct 50% gray point (16384) using the Levels Adjustment Layer, with "output white = 254".

We fall one short of all values near 50% gray (for example we get 16383 instead of 16384 for 50% gray), so we have to add "+1" to all pixel values in 16-bit mode. Tricky. Create a Fill Layer, Mode: Linear Dodge (Add), Opacity: 1%, Fill: 50%, Color #010101.

Select layer A, Merge (Ctrl+E). Delete layer B.
Photo of Damian Sepczuk

Damian Sepczuk

  • 4 Posts
  • 1 Reply Like

Posted 2 weeks ago

  • 2

Be the first to post a reply!