We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tint()
Im trying to overlay a color over an image. I know there is the tint() function but it results in wrong colors.
I have this base image i want to colorize with the hex color #ffc680.
#ffc680
This is my code:
await sharp('base.png') .tint({ r: 255, g: 198, b: 128 }) // #ffc680 .toFile('result.png')
As you can see the colors are lighter than the expected result. Does anybody have a solution to this?
I also tried using Jimp and can create a correct image using Jimp's color filter: https://github.com/oliver-moran/jimp/tree/master/packages/plugin-color#color
const baseImage = await Jimp.read('base.png') const mask = baseImage.clone().color([ { apply: 'mix', params: [ 'ffc680', 100 ] } ]) baseImage.composite(mask, 0, 0, { mode: Jimp.BLEND_MULTIPLY }) await baseImage.writeAsync('result.png')
Hope someone can help me.
The text was updated successfully, but these errors were encountered:
Hi, did you see #3338? It contains some discussion around ways to improve tint.
tint
Sorry, something went wrong.
Let's track this at #3338
No branches or pull requests
Im trying to overlay a color over an image. I know there is the
tint()
function but it results in wrong colors.I have this base image i want to colorize with the hex color
#ffc680
.This is my code:
Result:
Expected:
As you can see the colors are lighter than the expected result. Does anybody have a solution to this?
I also tried using Jimp and can create a correct image using Jimp's color filter: https://github.com/oliver-moran/jimp/tree/master/packages/plugin-color#color
Hope someone can help me.
The text was updated successfully, but these errors were encountered: