Closed beerus266 closed 6 months ago
The PSD file contains original, unmasked bitmaps for each layer and the mask. The masking itself is dome by photoshop when you open the file. If you want masked result you need to use canvas from layer.mask.canvas
field on the group layer to mask the layer yourself. It should be easy as it's just iterating over all pixels and multiplying the layer alpha channel pixels by mask color channel pixels.
I am not clear what you means. Please, write a example code for me. It can be ease to understand. Please ?
I am not clear what you means. Please, write a example code for me. It can be ease to understand. Please ?
@beerus266 I think it would be wise for you to start from the basics of pixel manipulation in canvas and then move on from there: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Pixel_manipulation_with_canvas
It's nothing to do with this library, but with image manipulation in general.
I found this interesting library, but I get an issue when try to apply global mask to each children layer. This is my PSD file. I have a folder contain a mask, inside this folder has layers. If Disable mask layer, all children layers will be normal, no crop. Link this:
But when Enable mask layer, the layers will be crop. My expect:
I am coding a own project using both
ag-psd
andpsd.js
library to read file PSD to export all layers to base64 or png image. Export every normal layers is OK, but I haven't solve above situation yet. Can anyone help me ? Thanks a lot