Newbie question regarding batch conversion

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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Newbie question regarding batch conversion

Post by fmw42 »

The example works fine under UNIX. There are special rules for Windows. See http://www.imagemagick.org/Usage/api/#windows that deal with \ and escape characters.
convert -size 140x80 xc:none -fill grey \
-gravity NorthWest -draw "text 10,10 'Copyright'" \
-gravity SouthEast -draw "text 5,15 'Copyright'" \
miff:- |\
composite -tile - logo.jpg wmark_text_tiled.jpg
This is one command, not a script, but a complex one. The \ at the end of each line are a continuation character. You probably need to remove these and make it all one long line.

The first four lines create a transparent image of size 140x80 and draw gray text in the northwest and southeast corner of that image and output it as miff:- which is an internal temporary image which is then piped to the last line, the composite command which tiles that image (read in as the single -) onto logo.jpg and outputs it as wmark_test_tiled.jpg.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Newbie question regarding batch conversion

Post by el_supremo »

I've tried that command on WinXP and it works.

Code: Select all

convert -size 140x80 xc:none -fill grey -gravity NorthWest -draw "text 10,10 'Copyright'" -gravity SouthEast -draw "text 5,15 'Copyright'" miff:- | composite -tile - logo.jpg wmark_text_tiled.jpg
I'm using IM V6.3.9.
Which version of ImageMagick are you using?

Pete
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Newbie question regarding batch conversion

Post by Bonzo »

Interesting example; works with php as well.

I presume the miff image is in the memory; does anyone have a link to more detailed info about how it works - How many miff images can you have are they over written etc.? It should be useful with my examples as I will not need the tempory images.

I had a look at the pipe a while ago and could not get it to work but it works OK with this BUT why do I need the - here ? - original.jpg the code fails without it.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Newbie question regarding batch conversion

Post by anthony »

The - means read from standard input (the pipe)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply