DEV Community

Cover image for Why Photoshot keeps the original color when you edit in black and white
김기선
김기선

Posted on Fully Autonomous

Why Photoshot keeps the original color when you edit in black and white

Photoshot Looks development journal, part 1 of 9.

In the first build of Silver for Photoshot Looks, I converted a three-color test image to black and white and tried two different Color Filter hues. Both produced identical pixels. I could see the same problem with a Control Point. Changing how strongly it selected by color had no effect after the image went monochrome.

Nik Silver Efex gave me a clue. It opens in neutral black and white, yet it still lets you brighten or darken parts of the image based on their original hues. Its local controls also let you adjust lightness and chroma selectivity separately. Those behaviors suggested a design for Photoshot. Keep the original color available for selection, and apply the edit to the image as it looks now. DxO Silver Efex guide

What I inferred and built

The Color Filter now reads hue from the original photo and uses it to shift the brightness of the current monochrome image. That keeps the tonal work already in the edit. A Control Point uses lightness from the image at that stage and color from the original. The radius and feather tell it where to look, and the sampled lightness and color help it decide which nearby pixels to select.

I also had to decide where a local edit belongs in the rendering order. The first build used the point as a mask for the global adjustment. Placing a point on a face could make an exposure adjustment disappear from the rest of the frame. The new renderer applies the global adjustment first and layers the point’s own settings on top. A brighter face and an unchanged background are now two outcomes I can test in the same image.

What I adapted from public implementations

I used Björn Ottosson’s published Oklab coefficients in a NumPy implementation. For Levels & Curves, I adapted the weighted slope calculation documented by SciPy’s PCHIP implementation, simplified the endpoint rules, and sampled the curve into a lookup table. I studied darktable’s Tone Equalizer source for how it preserves detail around edges. Photoshot’s own tone controls use smooth weights for shadows, midtones, and highlights, with OpenCV’s guided filter separating detail at different scales.

Oklab reference implementation · SciPy source · darktable source · OpenCV guided filter

How I checked the result

After the fix, the two Color Filter hues gave different results on the same test patches. In the local-adjustment test, the sampled area inside the point changed by an average of 26 levels on an 8-bit scale. The sampled area outside it stayed exactly the same as the global-only render. A print-border test also confirmed that the center of the image stayed untouched.

The portrait in the demo puts those decisions together. I started with Silver Print, lifted the light on the face with one Control Point, added a print border, and compared the result with the color original. That workflow shipped in Photoshot Looks 0.4.6 for the web editor with the Windows companion.

AI drafted the prose from the project’s implementation and test records under the project owner’s direction.

Top comments (0)