Separate the luminance from the chrominance in an image
img = Import["https://i.stack.imgur.com/2L3Hc.png"]
You can also use ImageMultiply
or ImageApply
as follows:
ImageMultiply[ColorConvert[img, "CMYK"], {1, 1, 1, 0}]
ImageApply[{1, 1, 1, 0} # &, ColorConvert[img, "CMYK"]]
% == %%
True
ImageMultiply[ColorConvert[img, "CMYK"], 1 - {1, 1, 1, 0}]
ImageApply[(1 - {1, 1, 1, 0}) # &, ColorConvert[img, "CMYK"]]
% == %%
True
Here's something that uses the "LAB"
colorspace:
butterfly = ColorConvert[Import["https://i.stack.imgur.com/2L3Hc.png"], "LAB";
To kill the color channels:
ImageMultiply[butterfly, {1, 0, 0}]
Or to put everything on max "lightness" (an approximate luminance):
ColorCombine[
Prepend[
ColorSeparate[butterfly][[2 ;;]],
ConstantImage[1, ImageDimensions[butterfly]]
],
"LAB"
]