Hi everyone.
Any ideas how to go about converting a circle to square? I am looking for something like this https://www.flickr.com/photos/sbprzd/362529354/
My example was accomplished in MathMap. Maybe ImageMagick isn't ideal for this sort of thing but I would like to give it a shot. Basically the source image would be square and the circle bounded by the square would be mapped to the square.
I appreciate any help!
Joseph
Circle to Square transformation?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Circle to Square transformation?
I would do it with an "-fx" expression. Within that expression, for the current pixel, calculate the distance from the centre, and the angle from the vertical. From these two, calculate the polar distance for the source pixel for this current pixel. The polar angle is the same. Thus you have the (x,y) of the source pixel.
Perhaps this is very similar to your MathMap operation.
Perhaps this is very similar to your MathMap operation.
snibgo's IM pages: im.snibgo.com
Re: Circle to Square transformation?
Thanks Snibgo...I'm going to get started on this!
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Circle to Square transformation?
"-auto-level" would be good for this. See http://imagemagick.org/script/command-l ... auto-level
Or perhaps "-evaluate Multiply 10", or some other number.
Or perhaps "-evaluate Multiply 10", or some other number.
snibgo's IM pages: im.snibgo.com