I have application where I need to change colors of image by altering values of hue, saturation and lightness.
Following is the sample image:
When I will pass HSL value as 90, 100, 50 respectively.
It should return image as follows
Any idea how to achieve this in node sharp?
Thanks in Advance.
Answered here:
https://github.com/jcupitt/libvips/issues/770
Summary: at the command-line you can do:
$ vips colourspace red-shirt.jpg x.v lch
$ vips linear x.v green-shirt.jpg "1.5 1.5 1" "0 0 120"
to swap to LCh colourspace and adjust hue and chroma, or in node-vips you can do:
var vips = require('vips');
var image = vips.Image.newFromFile(process.argv[2]);
image = image
.colourspace('lch')
.add([0, 0, 120])
.multiply([1.5, 1.5, 1]);
image.writeToFile(process.argv[3]);