Page 1 of 1
Re: STR without -distort
Posted: 2008-10-16T10:59:31-07:00
by fmw42
rborn wrote:hi
I am trying to make a STR (Scale Translate Rotate) but
without the -distort option, as many hosted servers have older versions of IM.
i managed to make it with a code like this
Code: Select all
convert -size 600x480 xc:black -draw "translate 219,324 rotate 21 image over -330,-264 660,528 'e.jpg' " nat.png
but the quality is awful
e.jpg looks just fine, but the result, nat.png is very pixelated
can you help me with another way of doing this?
thank you
You could insert your e.jpg image into a larger background image such that the center of the new image contained the e.jpg at the offset coordinates you want. Then use -rotate (about the new center which is now at your offset coordinates), Then use -trim to remove the background.
Re: STR without -distort
Posted: 2008-10-16T22:40:12-07:00
by anthony
Have you tried the individual components of the distortion?
The edges are pixelated. but I think this may be a limitation of the draw. Also I am not certain if draws read in scaling is a 'sample' type scale or a proper resize with a proper resize filter.
Generating a distortion basied on specific scale, Rotate and translate parameters is actually not easy which was one reason the SRT distrtion was added. Internally in draw, and distort the various actions would be combined into a affine matrix.
You can find out more about this in...
http://www.imagemagick.org/Usage/distort/affine/
Also included are reference to some utilities for generating the affine matrix (either for -draw or -transform) from separate S,R,T components
http://www.imagemagick.org/Usage/distor ... ne_scripts
These scripts were the prototype for the eventual addion of the -distort SRT method.