Tuesday, 15 March 2011

command line - Imagick6 "-gravity SouthEast" while using -draw 'image [...]' failed -



command line - Imagick6 "-gravity SouthEast" while using -draw 'image [...]' failed -

i have switch imagick version 5 imagick version 6 , noticed following

while using command:

convert -gravity southeast -draw 'image on 0,0 0,0 overlay.png'

in version 5 overlay.png beingness added bottom right corner (southeast) expected!

but version 6 of imagemagick failed , position of overlay.png @ top left corner!

the command used in typo3 "imgresource.params" http://docs.typo3.org/typo3cms/typoscriptreference/functions/imgresource/index.html

but think has nil cms, compatibility of im5 , im6

anyone knows how solve this...?

you can utilize command instead:

convert background.jpg foreground.jpg -gravity southeast -compose src_over -composite output.jpg

so if our background:

and our foreground:

we next result:

actually, think looks improve on other side of image, flopped still face inwards :-)

convert background.jpg \( tiger.png -flop \) -gravity southwest -compose src_over -composite out.jpg

updated answer

sorry hear command doesn't work within typo3. there version here may work you...

first width , height of background , foreground images - guess there way in typo3, i'll this:

identify -format "%w %h" background.jpg 906 603

so background 906 px wide , 603 px high, and

identify -format "%w %h" tiger.png 258 296

the tiger 258 px 296. can overlay using geometry this, subtracting width , height of tiger width , height of background give offset top left of image:

convert background.jpg tiger.png -geometry +648+307 -composite out.png

which gives same effect gravity southeast. maybe there...

updated 1 lastly time

this 1 must there... set right offsets in original draw command rather relying on gravity. first 2 numbers x,y offsets of top left corner of overlaid image top left corner of background image, , sec x,y pair offsets of bottom right corner of overlaid image. basically,

x1,y1 = width background - width overlay, height background - height overlay x2,y2 = width background, height background convert background.jpg -draw 'image on 648,307 906,603 tiger.png' out.jpg

command-line compatibility imagick typo3-6.2.x

No comments:

Post a Comment