Rotating image around a given point?
Rotating image around a given point?
I'm trying to rotate an image aroung a given point, but it doesn't work at all...
This is how I tried it:
convert -distort ScaleRotateTranslate '34,29 100 20' pic_a.jpg' 'pic_b.jpg'
...but nothings happend.
Anyone who can explain the needed arguments for SRT to me?
This is how I tried it:
convert -distort ScaleRotateTranslate '34,29 100 20' pic_a.jpg' 'pic_b.jpg'
...but nothings happend.
Anyone who can explain the needed arguments for SRT to me?
Re: Rotating image around a given point?
Does your version of IM support that distort ?
Read the image in first
Thats all I can think of, in your post you are missing a ' I pressume this is a typing error?
Code: Select all
convert -list distort
Code: Select all
convert pic_a.jpg -distort ScaleRotateTranslate '34,29 100 20' pic_b.jpg
Re: Rotating image around a given point?
Mmmh, there seems to be no support for distort. How can I add that?
(Yes, that was a typing error )
(Yes, that was a typing error )
Re: Rotating image around a given point?
I do not know when distort came in; what version are you using?
Re: Rotating image around a given point?
Looks like it came in around IM v6.3.5-1
Re: Rotating image around a given point?
Thanks! I'm gonna ask my admin to update it...
Re: Rotating image around a given point?
Yes, it works!
But I got two questions
- I want to have the rotating point the new middle-point of the new image, how can I do that?
- How can I set the background of that new image to white?
But I got two questions
- I want to have the rotating point the new middle-point of the new image, how can I do that?
- How can I set the background of that new image to white?
Re: Rotating image around a given point?
Its good to know you now have it working; have you checked this page out http://www.imagemagick.org/Usage/distorts/ ?
I do not know if you can use -background white in your code for a white background, but the page above should help with that.
I have no idea how you would do this
I do not know if you can use -background white in your code for a white background, but the page above should help with that.
I have no idea how you would do this
I want to have the rotating point the new middle-point of the new image
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Rotating image around a given point?
convert <image> -virtual-pixel white -distort SRT "X,Y Scale Angle NewX,NewY" <result>
-virtual-pixel white will make the background white
-distort SRT "X,Y Scale Angle NewX,NewY"
will rotate and scale about X,Y and then translate that to NewX,NewY
see
http://www.imagemagick.org/Usage/distorts/#srt
http://www.imagemagick.org/script/comma ... tual-pixel
-virtual-pixel white will make the background white
-distort SRT "X,Y Scale Angle NewX,NewY"
will rotate and scale about X,Y and then translate that to NewX,NewY
see
http://www.imagemagick.org/Usage/distorts/#srt
http://www.imagemagick.org/script/comma ... tual-pixel
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Rotating image around a given point?
Note scale probably should be 1.0 unless your want an image 100 times bigger!!!
With +distort the center point will not move on the layer image, (virtual canvas location). of course in terms of location on the actual image, it may be in a different pixel coordinate!
In -distort the output image size does not change, so the center point will still be the original actual image pixel location. in general -distort ignores virtual 'layer' position completely.
With +distort the center point will not move on the layer image, (virtual canvas location). of course in terms of location on the actual image, it may be in a different pixel coordinate!
In -distort the output image size does not change, so the center point will still be the original actual image pixel location. in general -distort ignores virtual 'layer' position completely.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/