Trim and resize PSD, convert to GIF - does not work

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
smantscheff
Posts: 7
Joined: 2010-10-19T03:07:36-07:00
Authentication code: 8675308

Trim and resize PSD, convert to GIF - does not work

Post by smantscheff »

I'm trying to convert a bunch of PSD files by trimming the transparent space, resizing and converting to GIF.
Find a sample at http://www.ovula.de/images/ovula-caweli ... narzt1.psd

First try:

Code: Select all

convert zahnarzt1.psd -trim -resize 500x500 zahnarzt1.gif

Result: http://www.ovula.de/images/ovula-caweli ... narzt1.gif
The result is resized, but the transparent space not cropped.

Second try:

Code: Select all

convert zahnarzt1.psd -trim zahnarzt1.trimmed.psd
convert zahnarzt1.trimmed.psd  -resize 500x500 zahnarzt1.trimmed.gif
Result: http://www.ovula.de/images/ovula-caweli ... rimmed.gif
The result is trimmed o.k, but somehow some blue border at the top and a GIF animation sneaked into the result.

I have similar issues with about 25 of 50 images. The others convert fine.
How can I resolve this problem?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Trim and resize PSD, convert to GIF - does not work

Post by fmw42 »

add +repage after your -trim

convert zahnarzt1.psd[0] -trim +repage zahnarzt1.gif


That seems to work for me with IM 6.7.4.4 Q16 Mac OSX Tiger.

see
http://www.imagemagick.org/Usage/crop/#trim
smantscheff
Posts: 7
Joined: 2010-10-19T03:07:36-07:00
Authentication code: 8675308

Re: Trim and resize PSD, convert to GIF - does not work

Post by smantscheff »

Thanks a lot. This seems to have done the trick.
Post Reply