[magick-users] Processing PSD Images
Anthony Thyssen
A.Thyssen at griffith.edu.au
Mon May 18 17:50:12 PDT 2009
On Mon, 18 May 2009 15:44:42 +0200
Axel Rosenski <rosenski at wave-computer.de> wrote:
| Hi there,
|
| this is my first Post on this list and I hope you can help me.
|
| I'm running Imagemagick (Version: ImageMagick 6.4.3 2008-12-03 Q16 OpenMP
| http://www.imagemagick.org) on a linux machine and I have a set of
| Photoshopimages in varying sizes that I would like to convert into JPG.
|
| I have to extract a clipping path, put it in the middle on a blue canvas with
| a size of 2000x2000 pixel and save this image, resize it in the next step and
| add a watermark image. I like to do this with one convert/composite call.
|
| I found two (nonsatisfying) solutions:
|
| > convert -size 2000x2000 /path/to/foto.psd[0] -flatten -resize 2000x2000
| xc:blue -gravity center +swap -composite -write /path/to/test.jpg -resize
| 450x450 -write /path/to/test450.jpg -resize 200x200 /path/to/test200.jpg
|
| This creates me a canvas of 2000x2000px and resizes my images to the given
| size. When I try to add my watermark I get a proper test.jpg, but test450.jpg
| gets completely white.
|
| The other solution I found out is:
|
|
| >convert "foto.psd[1]" -fill "blue" -resize "2000x2000" -size "2000x2000"
| xc:"blue" +swap -gravity "Center" -flatten -write "/path/to/test.jpg" -
| composite -gravity "center" "/path/to/watermarkimage" -resize "450x450" -write
| "path/to/test450.jpg" -delete 1 -resize "200x200" "/path/to/test200.jpg"
|
| With this call I have two problems:
| - the clipping path image is not centered in the middle of the image
| - the medium and small images are not usable.
| They have a black background with a white bar in the foreground where the
| watermarkimage should be. I played around with some options (-draw 'color 0,0
| floodfill' changed position of command line options).
|
| Can anyone help me to get those two calls together?
|
First it would have been better if you could have formated your command
into multiple lines so one major image processign step is on each line.
That makes it a LOT easier to read!
Second a canvas is NOT needed for -flatten, as it will create a canvas
as part of its processing.
Also -flatten does NOT understand -gravity. That is a composite setting
not a image layering setting.
For info see
Composite Geometry/Gravity vs Layer Canvas/Page Offsets
http://www.imagemagick.org/Usage/compose/#geometry
Also look at examples on flattening, with canvas adjustments (using -page)
http://www.imagemagick.org/Usage/layers/#flatten
I suggest you use -composite instead, in whcih case you will need to
generate the canvas image.
Downloading images..
| If you need an image for testing purposes you can get it at:
|
| http://ar.nutzerverwaltung.de/foto.psd (careful, it has ~33 MB)
| The watermarkimage is available here:
| http://ar.nutzerverwaltung.de/stempel_axel.png
I get errors with that image!
identify: Improper image header `foto.psd' @ psd.c/ReadPSDImage/662.
So I am unable to continue, as I can't see how your 'clipping' mask is
being handled.
Anthony Thyssen ( System Programmer ) <A.Thyssen at griffith.edu.au>
-----------------------------------------------------------------------------
"I have a top secret gravely important assignment here."
"What other kind do I ever get?" -- Stainless Steel Rat (Revenge)
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
More information about the Magick-users
mailing list