convert is making animated gif

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
parsnipnose3000

convert is making animated gif

Post by parsnipnose3000 »

I am trying to make a gif with text using two fonts.

I cannot work out the syntax for this, and keep making an animated gif.

The code I am using is :

convert -background white -fill black -font arial-bold -size 500x35 -pointsize 24 label:"The Sunday Times" -font arial -pointsize 12 label:"19.08.07" -bordercolor white -crop 414x35+0+0 +repage "sundaytimes.gif"

Here is an example of what I want to achieve, and what I keep getting.

http://www.thefuturecanwait.com/image.htm
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: convert is making animated gif

Post by Bonzo »

Your problem may be the Label ?

I would use annotate or draw:

Code: Select all

convert -size 414x35 xc:white -fill black -font arial-bold -pointsize 24 -gravity west -annotate +0+0 \"The Sunday Times\" -font arial -pointsize 12 -gravity east -annotate +0+0 \"19.08.07\" sundaytimes.gif
I can not check this as am work.

I have changed -background to xc: and it worked OK
parsnipnose3000

Re: convert is making animated gif

Post by parsnipnose3000 »

Many thanks for your help. I tried this code, and have added the output image to the page mentioned in my original post. It also gives me 2 errors, so maybe there is a syntax problem?

convert : unable to open image 'sunday' : no such file or directory
convert : unable to open image 'times' : invalid argument

Any ideas?
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: convert is making animated gif

Post by el_supremo »

The problem is that each label: creates an image. When you save these to a GIF you get an animation because there are two images.
You need to combine the two into one and then save them.

This command will do close to what you have in your example - note the spaces I've added in the strings.

Code: Select all

convert -background white -fill black -font arial-bold -pointsize 24 label:" The Sunday Times" -font arial label:" 19.08.07 " +append sundaytimes.gif
Pete
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: convert is making animated gif

Post by Bonzo »

How are you creating your image php ? I was not thinking when I posted and included the escape character \

It worked Ok for me but it looks like the " is the problem. Try replaceing the \" with '

If you have The_Sunday_Times it would probably be OK, for some reason the space character causes problems. That is why you need to put everything inside a " " or ' '
Post Reply