Magick equivalent of GIMP Hue-Chroma transformation

Viewed 67

Using Gimp, given an input image, I can improve its contrast using Colors > Hue Chroma... by setting Chroma=50 (in a scale between -100 and 100) and leaving Hue=0 and Lightness=0. So it appears I'm doing an HCL transformation.

Is there an equivalent command for Magick?

The following image shows the GIMP effect: Image

1 Answers

Updated Answer

Not sure about this at all. I think you can get pretty close with -modulate if you go into an LCH colourspace, but I have no idea if it will work consistently. I got:

magick cXDv3.jpg -define modulate:colorspace=LCH -modulate 100,150 result.jpg

If that doesn't work, or is not to your liking, read on...


Generic Method for any GIMP filters

The method below should allow you to replicate any GIMP filter with ImageMagick - as long as it is a pure "point process", I mean one where each pixel's output value is purely derived from its input value and not an "area process" where surrounding pixels contribute - such as blurring or median filtering, for example.

It's called a HALD-CLUT. You would create a HALD-CLUT something like this:

magick hald:16 clut.png

Then take that file (clut.png) into GIMP and apply your GIMP processing on it and save the result as GIMP-H0-C50-L0.png so we know how GIMP affects each colour. You do that just once.

Then you go back to ImageMagick and apply that CLUT to your image:

magick input.png GIMP-H0-C50-L0.png -hald-clut result.png

That gives me this:

enter image description here

and I think you'll agree the left side looks pretty similar to the right side of your input image.

Original Answer

I don't know what that command does in GIMP, but you can convert to HCL colourspace in ImageMagick and select the Chroma channel for modification like this:

magick INPUT.PNG -colorspace HCL -channel G ...

You then want to do something ? to affect the Chroma channel, so try -auto-level for now, and then return to sRGB colourspace and save:

magick INPUT.PNG -colorspace HCL -channel G -auto-level +channel -colorspace sRGB RESULT.PNG

Then you need to provide more clues or experiment more with what that command does in GIMP - or provide examples.

Related