Page 1 of 1

Ignoring "preview" layer while converting PSD to JPEG?

Posted: 2007-07-08T07:06:06-07:00
by dsearles
Is there a generic means of ignoring the "preview" layer in PSD files while flattening them to JPEG? When I do:

convert test.psd -flatten test.jpeg

I get a JPEG which is just the "preview" layer (as that is the last one in the file). If I do NOT use "-flatten", I get 2 JPEGs: one with the image layer (my test image has just a single layer) and another with the "preview" layer.

I realize I can do:

convert test.psd[0] test.jpeg

but I want to use this technique for PSDs I know nothing about. What I'd like is something like:

convert test.psd[0-(n-1)] -flatten test.jpg

Any ideas?

Re: Ignoring "preview" layer while converting PSD to JPEG?

Posted: 2007-07-08T13:48:31-07:00
by dsearles
Nevermind...

After reading the docs more thoroughly, I found I actually CAN do:

convert test.psd[0--2] -flatten test.jpg

Where the "-2" is the next to last layer ("-1" would be the last).

Re: Ignoring "preview" layer while converting PSD to JPEG?

Posted: 2007-07-08T23:48:39-07:00
by anthony
That assumes psd files always contains a preview image, or the PSD
file only ever has one image in the file.

Can they have multiple images?

Is the preview optional for a multi-image form?

I would like to know for completeness in IM examples.