Starting from an image I would like to apply a custom filter to an image.
I have thought and implemented this filter in HSL space and it goes like this :
- Boost the saturation of the pixels that have a S value > .5
- Decrease the ones where S < .5.
Would I have the HSL Values instead of the HSB the code would go like this :
img = Import["ExampleData/lena.tif"];
ImageColorSpace[img]
img = ImageResize[img, 128];
img = ColorConvert[img, "HSB"];
imgd = ImageData[img];
newimg = ({#[[1]], 1/(1 + E^(10*#[[2]]*(#[[2]] - .5))), #[[3]]} & /@
imgd[[#]]) & /@ Range[Length[imgd]];
newimg = Image[newimg]
My Problem : I cannot figure out how to convert HSB (only hue based space in M9 to my knowledge) to HSL.
