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
I am using the unflatten command to make a version of a given image transparent.
unflatten
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"));
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:
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 unflatten operating only on the white pixels as documented.
Sorry, something went wrong.
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 unflatten operating only on the white pixels as documented.
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. Thanks!
No branches or pull requests
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: