composite and distort

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
cz2

composite and distort

Post by cz2 »

I use the following code to create pictures with round corners:

Code: Select all

composite -compose SrcIn -units pixelsperinch -density 150x150  -geometry 89.172342300415%x89.172342300415%+267.368+0.266 /html/photos/893.jpg /html/shapes/bigpictures.png /html/photos/893_final.png
I search for a solution to rotate the image (image center) and place it on the canvas "bigpictures.png" to the right coordinates. This works without rotation, but with rotation the position ist wrong. I found some examples with +distort, but i don´t know how i can use this with composite. I tried:

Code: Select all

composite -compose SrcIn -units pixelsperinch -density 150x150  +distort SRT 267.368,0.266,89.172342300415,89.172342300415,90  /html/photos/893.jpg /html/shapes/bigpictures.png /html/photos/893_final.png
Can anyone help me?
User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

Re: composite and distort

Post by GreenKoopa »

A +distort shouldn't be necessary. You just need to place the -rotate in the correct position. It should be after the image-to-rotate is read (the corner), but before the -geometry and not-to-rotate image is read.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: composite and distort

Post by anthony »

Geometry arguments are purely integers due to the way it works.

I definitely do not recommend doing anything complex in "composite" as it is just not designed for it.
Use the "convert" command instead with a -composite operator to specify the point in the processing you want the composition to occur. And remember to swap the order of the two images for "convert"

You may need to use parenthesis to limit which 'distort' is applied to.
http://www.imagemagick.org/Usage/basics/#parenthesis

Other than that it is VERY hard to determine exactly what you want to do. You don't actually say what you want or give any example images.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply