lunatechian (lunatech-ian)

one relating to, belonging to, or resembling lunatech

ImageMagick magic

I am experimenting a bit with ImageMagick. Here is a neat trick that I found. Suppose that you have an image (79.gif) and you want to make an ecard out of it, i.e a montage where 79.gif should appear on the left and your message to the recipient on the right. Here is how you can do it E:\>convert -font arial -pointsize 30 label:"The answer as always is\n42" miff:- | montage -tile 2x1 79.gif - myecard.png

The convert part creates a text label (with your message) and sends the output to the STDOUT , which is piped to the montage command. Montage takes care of stitching the message and the image together. Currently, the 79.gif loses its original resolution and gets resized to the label size. I will update this post further if I find out how to make it retain the original size. This is a good place to start if you are interested

Update : convert -font arial -pointsize 30 label:"The answer as always is\n42" miff:- | montage -geometry +2+1 79.jpg - myecard.png preserves the size of the original image and adds the message to the right of the image as well

Update : convert -size 1200x1600 xc:white -font arial -pointsize 40 -gravity Center -annotate +30+90 "Wishing you a very\nProsperous and a happy 2006\n \n From\n-- Lunatech" -trim +repage miff:- | montage -geometry +2+1 79.jpg - -quality 95 myecard.png does the job. I have added the quality 95 to bring down the file size of the myecard.png

Defined tags for this entry: