Re: Sophisticated fuzz with HSL definition?
Posted: 2014-06-01T16:55:34-07:00
I will explain what I need to process later. Now, its not clear why you use r, g, b on the left side of expression. Why dont you use hue, saturation and lightness?
I still dont understand how to use it. Why should I use r g b when working with HSL? Not clear how to calculate the r g b and why.
Why not to write it as so:
Should I change -size 360x1 to 1024x1 according width of my image?
I still dont understand how to use it. Why should I use r g b when working with HSL? Not clear how to calculate the r g b and why.
Why not to write it as so:
Code: Select all
REM Calculate colors from HSL to RGB .. and create mask
REM avgH=0.581944444
REM avgS=0.305
REM avgL=0.31
REM IM uses range of 0-100% for rgb() so I have to multiply by 100
SET avgH1=58.1944444
SET avgS1=30.5
SET avgL1=31
SET avgH2=44.44444444
SET avgS2=20.5
SET avgL2=38.5
SET fact=`convert xc: -format "%%[fx:360/255]" info:`
convert -size 360x1 xc: -colorspace HSL -fx "(hue>avgH && hue<avgH)?white:black" h.png
convert -size 360x1 xc: -colorspace HSL -fx "(saturation>avgS*%fact% && saturation<avgS*%fact%)?white:black" s.png
convert -size 360x1 xc: -colorspace HSL -fx "(lightness>avgL*%fact% && avgL<Yb*%fact%)?white:black" l.png
convert h.png s.png l.png -combine lut.png
convert ( image -colorspace HSL ) lut.png -clut mask.png
convert image -mask mask.png <processing> result