On Tue, 9 Jun 2009 04:14:42 +1000
[email protected] (Simon) wrote:
| Simon <[email protected]> sent the following
| comment to "anthony", about "Chaining ImageMagick commands".
| You are reading it:-
| ------------------------------------------------------------
| Hi,
|
| I was looking through your page of ImageMagick examples, and have
| hunted around the web, but can't seem to find a way to achieve what I
| want. What I would like to do is to add an image over top of another
| image, and then rotate the two. But I would like to achieve it in one
| line.
|
| For instance, I can do what I need using the following commands:
| composite -gravity west PaperClip.png random.jpg random_rotated.png
| convert -rotate -20 random_rotated.png random_rotated.png
|
You either 'pipeline' the output of one command to another...
composite -gravity west PaperClip.png random.jpg miff:- |\
convert -rotate -20 - random_rotated.png
OR do the composition in "convert" (not the image order change)
convert random.jpg PaperClip.png -gravity west -composite \
-rotate -20 random_rotated.png
This is documented in IM Examples.
Using MIFF for pipelines
http://www.imagemagick.org/Usage/files/#miff
Alternative Composition Methods
http://www.imagemagick.org/Usage/compose/
We probably need a section called 'Using UNIX Shell with ImageMagick'
Simular to what is provided for Windows Batch Scripting
http://www.imagemagick.org/Usage/windows/
Prehaps Fred Weinhaus would like to write it up, seeing as he has done
a lot of such shell scripts :-)
| But I can't seem to find a way to chain together these commands in an
| order so I get the desired results. The closest I can seem to get is
| the following: convert -rotate -20 -background none random.jpg
| PaperClip.png -composite -gravity west random_rotated.png
|
| But when I do this, the overlayed image (in this example the
| Paperclip.png) appears at the top of the image, instead of in the
| center.
|
You MUST give the operation settings BEFORE the operation that would use
them. -gravity for example has to be BEFORE -composite
Also as you want to rotate the image AFTER composition, do that
operation AFTER the composition!!!
See IM Examples, Basics
http://www.imagemagick.org/Usage/basics/
| Do you happen to know if chaining these commands together in the way I
| would like is possible? Any help you might be able to provide would
| be greatly appreciated.
|
See above.
Anthony Thyssen ( System Programmer ) <[email protected]>
-----------------------------------------------------------------------------
Dragons do not have much use for paper... particularly paper money.
Flammable currency is not our idea of a sound investment for a society.
--- Robert Asprin, "M.Y.T.H. Inc. Link"
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users