Distort arc: small top and bottom radii
Posted: 2009-08-22T14:51:58-07:00
Hi,
I'm writing some bash scripts to do some video compositing with imagemagick. One of the commands involves the "-distort arc" command. I'm using it to alter a gradient mask that then is used to composite two images. The complete bash scripts can be seen under http://kaputte-moderne.sweat-lodge.de/aurora.html and there's also a video there to help you get an idea of where I'm going with this. The script with this particular command is called sunset.
Anyway processing times get ridiculously long when the top radius and bottom radius parameters get very small or close to each other (not sure which one is causing this). My question is whether there is any way around this? If not, is there a correlation between image size, top radius and bottom radius limits, and reasonable processing times? What I mean is, given the image size can I write a formula that will give a minimum top and bottom radius value that will not take too long to process?
Anyway, here's the command I'm using:
convert -size 720x576 gradient: -rotate 180 -sigmoidal-contrast 50,100% -distort arc 150 -gravity north -crop 720x576+0+0 -resize 720x576! +repage maskC.mpc
convert input2.png \( input1.png \( \( -size 576x720 gradient: -rotate 90 \) maskC.mpc -channel RGB -combine \) -fx 'p{v.r*w,v.g*h}' \) \( -size 720x576 gradient: -set option:distort:viewport 720x576-360-576 -distort arc 180,0,15,0 -negate \) -compose src-over -composite output.png
Would be grateful for any clue you could give me, Rob
I'm writing some bash scripts to do some video compositing with imagemagick. One of the commands involves the "-distort arc" command. I'm using it to alter a gradient mask that then is used to composite two images. The complete bash scripts can be seen under http://kaputte-moderne.sweat-lodge.de/aurora.html and there's also a video there to help you get an idea of where I'm going with this. The script with this particular command is called sunset.
Anyway processing times get ridiculously long when the top radius and bottom radius parameters get very small or close to each other (not sure which one is causing this). My question is whether there is any way around this? If not, is there a correlation between image size, top radius and bottom radius limits, and reasonable processing times? What I mean is, given the image size can I write a formula that will give a minimum top and bottom radius value that will not take too long to process?
Anyway, here's the command I'm using:
convert -size 720x576 gradient: -rotate 180 -sigmoidal-contrast 50,100% -distort arc 150 -gravity north -crop 720x576+0+0 -resize 720x576! +repage maskC.mpc
convert input2.png \( input1.png \( \( -size 576x720 gradient: -rotate 90 \) maskC.mpc -channel RGB -combine \) -fx 'p{v.r*w,v.g*h}' \) \( -size 720x576 gradient: -set option:distort:viewport 720x576-360-576 -distort arc 180,0,15,0 -negate \) -compose src-over -composite output.png
Would be grateful for any clue you could give me, Rob