Closed CavellHuang closed 5 months ago
The PSD file contains image for each layer and a composite image of the entire drawing. If you want to create composite image of only some of the layers, you'd have to composite them yourself, probably using something like node-canvas (or HTML canvas element in a browser)
Can I do it by modifying psd document such as set the layer I don't want to output hidden, or use the layer canvas that psd document already had.
You can read canvas of each layer and composite canvas of the whole document from the PSD file, but if you modify the document the canvases will no longer be correct and you have to update them yourself this library will not modify them for you. You can't modify the document and then read the composite canvas because it will be the old version of the canvas.
You can read canvas of each layer and composite canvas of the whole document from the PSD file, but if you modify the document the canvases will no longer be correct and you have to update them yourself this library will not modify them for you. You can't modify the document and then read the composite canvas because it will be the old version of the canvas.
You can read canvas of each layer and composite canvas of the whole document from the PSD file, but if you modify the document the canvases will no longer be correct and you have to update them yourself this library will not modify them for you. You can't modify the document and then read the composite canvas because it will be the old version of the canvas.
Wath bothers me is how should I update the composite canvas if I modify the document. Do you have any ideas? Thanks so much!
If the document is very simple you can use basic functionality of HTML canvas (or node-canvas in nodejs) https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial
If the document is complex and uses more features you'll have to reimplement portions or entirety of Photoshop rendering engine.
If the document is very simple you can use basic functionality of HTML canvas (or node-canvas in nodejs) https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial
If the document is complex and uses more features you'll have to reimplement portions or entirety of Photoshop rendering engine.
ok, I will try it. Thanks again for your answer.
Is there any way I can select multi layers and composite them as one image?