Does anyone know how adjustment layers work in Photoshop? I need to generate a result image having a source image and HSL values from Hue/Saturation adjustment layer. Conversion to RGB and then multiplication with the source color does not work.
Or is it possible to replace Hue/Saturation Adjustment Layer with normal layers with appropriately set blending modes (Mulitiply, Screen, Hue, Saturation, Color, Luminocity,...)? If so then how?
Thanks
When the “Colorize” checkbox is checked, the lightness of the underlying layer is combined with the values of the Hue and Saturation sliders and converted from HSL to RGB according to the equations at https://en.wikipedia.org/wiki/HSL_and_HSV#From_HSL . (The Lightness slider just remaps the lightness to a subset of the scale as you can see from watching the histogram; the effect is pretty awful and I don’t see why anyone would ever use it.)
Hello I wrote colorize shader and my equation is as folows
inputRGB is the source image which should be in monochrome
colorRGB is your destination color
finalRGB is the result
pseudo code:
I think it's fast and efficient
I have figured out how Lightness works.
The input parameter brightness b is in [0, 2], Output is c (color channel).
Some tests:
However, if you choose some interval (e.g. Reds instead of Master), Lightness behaves completely differently, more like Saturation.
I've reverse-engineered the computation for when the "Colorize" checkbox is checked. All of the code below is pseudo-code.
The inputs are:
HSV(photoshop_hue, 100, 100).ToRGB()
photoshop_saturation / 100.0
(i.e. 0..1)photoshop_lightness / 100.0
(i.e. -1..1)pixel.ToHSV().Value
, scaled into 0..1 range.The method to colorize a single pixel:
Where
blend2
andblend3
are:Photoshop, dunno. But the theory is usually: The RGB image is converted to HSL/HSV by the particular layer's internal methods; each pixel's HSL is then modified according to the specified parameters, and the so-obtained result is being provided back (for displaying) in RGB.
PaintShopPro7 used to split up the H space (assuming a range of 0..360) in discrete increments of 30° (IIRC), so if you bumped only the "yellows", i.e. only pixels whose H component was valued 45-75 would be considered for manipulation.
reds 345..15, oranges 15..45, yellows 45..75, yellowgreen 75..105, greens 105..135, etc.
There are alternative possibilities, such as applying a falloff filter, as in: