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 have created a PSD file like the one pictured below.
What we want to save this time is this mask data.
To save it, I created the following source code.
import { fromFile } from "psd" import sharp from "sharp" const psdData = fromFile("src/resource/test_psd.psd") psdData.parse() const treePSD = psdData.tree() const mask = treePSD.children()[2].get("mask") const imageData = treePSD.children()[2].get("image").maskData sharp(imageData, { raw: { width: mask.width, height: mask.height, channels: 4 } }).png() .toFile("src/resource/test.png")
However, test.png was inverted to black and white.
I would like to know how to save without inverting black and white. Thank you in advance.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have created a PSD file like the one pictured below.
What we want to save this time is this mask data.
To save it, I created the following source code.
However, test.png was inverted to black and white.
I would like to know how to save without inverting black and white.
Thank you in advance.
The text was updated successfully, but these errors were encountered: