Command line:to overlay text over graphics image and crop

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
ummaga
Posts: 8
Joined: 2015-03-03T04:37:31-07:00
Authentication code: 6789

Command line:to overlay text over graphics image and crop

Post by ummaga »

Hi..
I have a Graphics Image as a background and I need to draw text(consider for example Arial/ point size could be any) over it and crop the composed image along the with text edges width and height..
It should work for all conditions ie multiline text/ single line text..
What is the fastest method command line argument should be given?
Thanks in advance..
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Command line:to overlay text over graphics image and crop

Post by snibgo »

The obvious method is to make a white image the same size, and write the text on this. "-trim" or "-format %@" gives you the required crop. Then write the text on the required background, and do the same crop.

I don't think you can do this in a single command.
snibgo's IM pages: im.snibgo.com
ummaga
Posts: 8
Joined: 2015-03-03T04:37:31-07:00
Authentication code: 6789

Re: Command line:to overlay text over graphics image and crop

Post by ummaga »

Hi thanks could you give me some example pls?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Command line:to overlay text over graphics image and crop

Post by Bonzo »

I for one do not mind helping someone out who has tried to get a result they want; but not for people who come and ask for some code without making any effort to try for themselves.

Searching this forum would answer most of your question; visiting this example site would also help: http://www.imagemagick.org/Usage

Your best bet is to use caption to create the text image; composite it over your base image and crop
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Command line:to overlay text over graphics image and crop

Post by fmw42 »

It is also important that you provide your version of Imagemagick and platform, since syntax may be different.

Please read viewtopic.php?f=1&t=9620
Post Reply