psd.js icon indicating copy to clipboard operation
psd.js copied to clipboard

How can I save a Group as PNG?

Open JASONPANGGO opened this issue 4 years ago • 5 comments

the pixelData in the Group layer is [] So I dont know if there is any othrer ways to save a Group as png

JASONPANGGO avatar Jun 05 '20 11:06 JASONPANGGO

hey, I also have this demand in my project and is looking for solution. happened to see this related issue yesterday, seems not accomplished yet.

cheqianxiao avatar Jun 09 '20 01:06 cheqianxiao

i also need this solution. anyone have solve ?

tidusvn05 avatar Oct 27 '20 05:10 tidusvn05

This library does not contain a built in renderer, so any images exported are raw pixel data (or a full preview, but that's already generated by Photoshop). The answer is that you can't do that with this library.

You can go through each layer in the group, extract its pixelData and combine them using a canvas (keep in mind layer positioning). This will not however preserve things such as patterns, layer styles, adjustment layers etc., doing that would require building a psd renderer.

szydlovski avatar Jan 15 '21 20:01 szydlovski

Thank for your suggestion!

tidusvn05 avatar Feb 26 '21 16:02 tidusvn05

Thank for your suggestion!

tidusvn05 avatar Feb 26 '21 16:02 tidusvn05