-
-
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
unflatten images to make them transparent still keep white pixels around the edges of the image #3989
Comments
Did you see https://sharp.pixelplumbing.com/api-operation#unflatten ? It looks like the "background" of this image consists of white and light grey pixels, with |
Yes, I have read the docs. Didn't notice the very light grey pixels, thank you for this insight. I'll try to use several steps, first to transform the light grey pixels to white and then use the unflatten command. Thanks! |
@Nivg Were you able to make progress with this? |
Unfortunately not yet; I am closing this, as the function is doing what it's suppose to do. |
I am using the
unflatten
command to make a version of a given image transparent.Example for a given image:
Here is the result:
As you can see, I still have a residue of white pixels around the resulted image.
I'm not sure why, maybe I'm missing something regarding the understanding of how unflatten works?
Sample code (nothing special here):
await sharp(path.join(productPath, fileName + ".png")).unflatten().toFile(path.join(productPath, fileName + "_transparent.png"));
The text was updated successfully, but these errors were encountered: