-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
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
NodeJS Sharp - Change the color of an image while retaining the transparency of the background #4015
Labels
Comments
Did you see tint? |
Thanks for your reply, but with tint(), the color is not natural and doesn't work with dark colors. |
Your "New Color background lose transparency" example is a JPEG, which does not support an alpha channel. |
This is an exemple with full png oldColor: https://ibb.co/zsWq6nH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for one of my projects, I need to change the color of an image based on the hex color chosen by the user. I managed to change the color of the image using Sharp, but I lose the transparent background. I would like help finding a solution to change the color of the image while keeping the background transparent.
Example GOOD:
Old Color
New Color
Example BAD:
Old Color
New Color background lose transparency
I don't have many solutions in mind, I've tried a few things that didn't work.
Here is my code:
The text was updated successfully, but these errors were encountered: