janko / image_processing

High-level image processing wrapper for libvips and ImageMagick/GraphicsMagick
MIT License
863 stars 76 forks source link

Translating modulate function from ImageMagick to Libvips. #102

Closed alexandrearc closed 2 years ago

alexandrearc commented 2 years ago

Hey guys,

I have this piece of code using ImageMagick that I want to convert to Libvips but i am not sure how to achieve the same behaviour as the modulate function:

ImageProcessing::MiniMagick .source(img) .colorspace(:srgb) .convert('jpeg') .modulate('120,10,100') .fill('#222b6d')

Basically I am not sure how to adjust brightness, saturation and hue using Libvips. I couldn't find it in the documentation.

Thanks, Alex

janko commented 2 years ago

Questions about converting ImageMagick commands to libvips are probably best asked at libvips discussions, the author is usually quick to provide the equivalent libvips command. In this case, the ImageMagick command to convert is:

magick source.png -colorspace srgb -modulate '120,10,10' -fill '#222b6d' destination.jpeg
alexandrearc commented 2 years ago

Sure @janko thanks!