Page 1 of 1

Trying hardly to simplify a Magick sentence, possible ?

Posted: 2011-01-25T01:51:54-07:00
by Daniel_in_the_sky
Hi everybody,

I have this 2 magick sentence working perfectly:

convert SRC_logo -fill white -font Arial.ttf -pointsize 20 \-gravity center -annotate 0 'TEXTE' EXIT_logo
convert BKG_full \( EXIT_logo -resize 50% \) -geometry +100+100 -compose over -composite BKG_full

Can i wrote that in 1 sentence ?
has you maybe allready understood im ritting TEXT on a logo then i reduce it 50% then im adding it on a background image.

Thank you everyone for your help. :D
D.

Re: Trying hardly to simplify a Magick sentence, possible ?

Posted: 2011-01-25T08:05:08-07:00
by el_supremo
Try this:

Code: Select all

convert BKG_full \( SRC_logo -fill white -font Arial.ttf -pointsize 20 -gravity center \
    -annotate 0 'TEXTE' -resize 50% \) -geometry +100+100 -compose over -composite BKG_full
If you're using windows, change the backslash at the end of the first line to ^

Pete

Re: Trying hardly to simplify a Magick sentence, possible ?

Posted: 2011-01-25T23:57:14-07:00
by Daniel_in_the_sky
Thank you very much !
But, I think there is a problem with your sentence
actually the probleme is the -geometry option, is not positioning the logo at x=100 and y=100 with this version.
Thank you for your help.

Re: Trying hardly to simplify a Magick sentence, possible ?

Posted: 2011-01-26T09:07:06-07:00
by el_supremo
Ah yes, the geometry is affected by the previous gravity setting.
This should fix it:

Code: Select all

convert BKG_full \( SRC_logo -fill white -font Arial.ttf -pointsize 20 -gravity center \
    -annotate 0 'TEXTE' -resize 50% \) -gravity northwest -geometry +100+100 -compose over -composite BKG_full
Pete

Re: Trying hardly to simplify a Magick sentence, possible ?

Posted: 2011-01-26T21:34:43-07:00
by Daniel_in_the_sky
Great its working !
Thank you

Now i have an other problem ^^
Why -geomtry +100%+100% do the same has -geomtry +100+100 ???

Also i did'nt find the way to multiplicate the X and Y value (pix)
I try -geomtry +2*100+2*100
-geomtry +"2*100"+"2*100"
-geomtry +(2*100)+(2*100)
-geomtry +2(100)+2(100)

Thank you for your really apreciate help
D.

Re: Trying hardly to simplify a Magick sentence, possible ?

Posted: 2011-03-17T21:37:29-07:00
by fmw42
IM does not allow calculations within -geometry. You need to set up variables to do the calculations and then use those variables within -geometry

newx=`convert xc: -format "%[fx:2*100]" info:`
newy=`convert xc: -format "%[fx:2*100]" info:`
convert .... -geometry +${newx}+${newy} ...


see fx escapes at http://www.imagemagick.org/Usage/transform/#fx_escapes