How do I export PSD layers as a single PSD file?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
chico
Posts: 6
Joined: 2019-05-12T11:34:23-07:00
Authentication code: 1152

How do I export PSD layers as a single PSD file?

Post by chico »

Hello! My case is as follows:

I have a PSD with several layers, some of which are inside groups (probably nested inside other groups). I'd like to export multiple layers of my choice into a single PSD while retaining the information of said layers (name, transparency, alpha masks, etc.)

Is this possible? I couldn't find this anywhere on the forum or on the internet.
I think I got it yesterday after trying multiple times, but now I can't do it anymore it seems. I'm on Windows btw.

Thanks!

IM Version: 7.0.8-24 Q16 x64 2019-01-17
Platform: Windows 7 x64

Source PSD (test file): https://www.dropbox.com/s/f2kqhijo8hwpp43/test.psd?dl=0

Desired result (PSD file) https://www.dropbox.com/s/36n557he6n0ke ... t.psd?dl=0

NEW ROUND OF TESTS:
(1)

Code: Select all

convert test.psd test2.psd
https://www.dropbox.com/s/k0tyhxqn837xj ... 2.psd?dl=0
Folders and alpha masks are gone. Corruption in some of the layers' colours. All layers are transparency locked.

(2)

Code: Select all

convert test.psd[2] test.psd[3] test.psd[4] test3.psd
https://www.dropbox.com/s/w8n9kvysjz11g ... 3.psd?dl=0
Folders and alpha masks are gone. Only two layers present. Layer 4* (1d) is not there? All layers have become empty and are in gray-scale. All layers are transparency locked. *Apparently, what matters is the order in which you created the layer, not the order in which you placed the layer.

(3)

Code: Select all

convert test.psd (-delete 5 -delete 1) test4.psd --> gives error in command line
convert test.psd -delete 5 -delete 1 test4.psd --> no error
https://www.dropbox.com/s/dorztjqpst4n2 ... 4.psd?dl=0
Folders and alpha masks are gone. There are indeed two layers missing so I assume those were the ones deleted. Corruption in some of the layers' colours. All layers are transparency locked.

(4)

Code: Select all

convert test.psd psd:additional-info=all test5.psd --> unable to open image
convert test.psd:additional-info=all test5.psd -> unable to open image
convert test.psd -psd:additional-info=all test5.psd --> unrecognized option
convert test.psd -additional-info=all test5.psd --> unrecognized option
convert test.psd -define psd:additional-info=all test5.psd --> no error
https://www.dropbox.com/s/fzsdscezz7l9e ... 5.psd?dl=0
Same as try (1) but this time layers are NOT transparency locked.

(5)

Code: Select all

convert testB.psd -delete 5 -delete 1 -define psd:additional-info=all testB2.psd
Tried deleting the folders from the source file. There is still corruption of colours.
(6)

Code: Select all

convert testB.psd -delete 5 -delete 1 -define psd:additional-info=all testB3.psd

Having the source file open seems to not have an effect at all.
(7)

Code: Select all

convert testC.psd -delete 5 -delete 1 -define psd:additional-info=all testC2.psd
Tried deleting the folders AND alpha masks from the source file. No corruption. Alpha masks might be to blame then.
Last edited by chico on 2019-05-12T20:07:15-07:00, edited 4 times in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do I export PSD layers as a single PSD file?

Post by fmw42 »

I am not sure you can do that with Imagemagick. It has limited PSD features. But see -define psd:additional-info=all|selective at https://imagemagick.org/script/command- ... php#define
chico
Posts: 6
Joined: 2019-05-12T11:34:23-07:00
Authentication code: 1152

Re: How do I export PSD layers as a single PSD file?

Post by chico »

Tried it @fmw42 but no dice :(
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do I export PSD layers as a single PSD file?

Post by fmw42 »

Post your input PSD file and your command line and version of Imagemagick and platform.
chico
Posts: 6
Joined: 2019-05-12T11:34:23-07:00
Authentication code: 1152

Re: How do I export PSD layers as a single PSD file?

Post by chico »

Done that! (I edited my original post). Is this what you mean, right?
IM Version: 7.0.8-24 Q16 x64 2019-01-17
Platform: Windows 7 x64
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do I export PSD layers as a single PSD file?

Post by fmw42 »

Testing on IM 6.9.10.44 Q16, the following command does not work properly. One of the IM developers will need to look at this.

Code: Select all

convert test.psd -define psd:additional-info=all result.psd
Post Reply