Trying hardly to simplify a Magick sentence, possible ?

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
Daniel_in_the_sky
Posts: 13
Joined: 2009-07-27T05:04:53-07:00
Authentication code: 8675309

Trying hardly to simplify a Magick sentence, possible ?

Post 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.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

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

Post 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
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
Daniel_in_the_sky
Posts: 13
Joined: 2009-07-27T05:04:53-07:00
Authentication code: 8675309

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

Post 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.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

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

Post 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
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
Daniel_in_the_sky
Posts: 13
Joined: 2009-07-27T05:04:53-07:00
Authentication code: 8675309

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

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

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

Post 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
Post Reply