[solved] PSD layer, drop shadow and exact image size

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
_ar_

[solved] PSD layer, drop shadow and exact image size

Post by _ar_ »

Hello,

I searched the web for a few days, but found no solution for my problem:
I have several Photohop images with an embedded path like
this one.


From this image I want to

* extract the path
* create drop shadow from path in 100x100
* composite with this watermark
* save as jpg with white background, watermark but without shadow in 450x450
* save as jpg with white background, watermark and drop shadow in 100x100

I tried a lot and it seems that there are two ways I have to arrange cleverly:

The first example gave me right-sized jpgs with white background and watermark (but no drop shadow)

Code: Select all

convert -size 450x450 xc:white -gravity center test.psd[1] -composite watermark.png -composite -write Big.jpg -resize 100x100 -write small.jpg
The second example gave me a red drop shadow on the big image but leads to wrong image sizes (466x419) (and no watermark image yet)

Code: Select all

convert -verbose test.psd[1] \( +clone -background red -shadow 60x3+10+10 \) +swap -background white -flatten Big.jpg
I played around with the -resize and -extent image operator and, but all it did was to crop my drop shadow. The option -gravity center also didn't help at all.
When I try to combine those two convert calls I get totally messed images.

Can anyone give me a hint or help me with some useful page?

Thanks in advance
AR
Last edited by _ar_ on 2009-02-04T04:55:14-07:00, edited 1 time in total.
_ar_

Re: PSD layer, drop shadow and exact image size

Post by _ar_ »

I found a solution combinig my convert calls:

Code: Select all

convert -size 450x450 xc:white -gravity center \( test.psd[1] \( +clone -background black -shadow 60x5+10+10 \) -background white -reverse -layers merge -resize 450x \) -composite watermark.png -composite -resize 100x100 final.jpg
Post Reply