Aidan Feldman
2011-05-17 03:33:29 UTC
Hi all-
So first I wanted to announce a Ruby gem I created called magickly, which
essentially offers Imagemagick as a web service. Please take a look - would
love any feedback:
https://github.com/afeld/magickly
As part of that plugin I include some pre-defined
effects<https://github.com/afeld/magickly/blob/master/lib/shortcuts.rb>,
i.e. tilt-shifting. I pretty closely mimicked the tilt-shift
tutorial<http://www.imagemagick.org/Usage/photos/#tilt_shift>on the
Imagemagick site, essentially running the following command:
convert source.png \\( +clone -sparse-color Barycentric '0,0 black
0,%[fx:h-1] white' -function polynomial 2,-2,0.5 \\) \
-compose Blur -set option:compose:args 15 -composite output.png
The result image looks good, but the app is serving photos on demand and it
takes forever (upwards of 30 seconds for a 640x480 on my Mac). Turnaround
time is more important than image quality here, so I was wondering if anyone
had any ideas for how to speed this up? Here are a few ideas I had - no
idea if they would make a difference:
- linear gradients, as mentioned in the tutorial
- storing the gradient map
- using variable blur
mapping<http://www.imagemagick.org/Usage/mapping/#blur> by
creating two gradient:black-white squares to get something parametric-ish
Any help would be appreciated. Thanks!
-Aidan
So first I wanted to announce a Ruby gem I created called magickly, which
essentially offers Imagemagick as a web service. Please take a look - would
love any feedback:
https://github.com/afeld/magickly
As part of that plugin I include some pre-defined
effects<https://github.com/afeld/magickly/blob/master/lib/shortcuts.rb>,
i.e. tilt-shifting. I pretty closely mimicked the tilt-shift
tutorial<http://www.imagemagick.org/Usage/photos/#tilt_shift>on the
Imagemagick site, essentially running the following command:
convert source.png \\( +clone -sparse-color Barycentric '0,0 black
0,%[fx:h-1] white' -function polynomial 2,-2,0.5 \\) \
-compose Blur -set option:compose:args 15 -composite output.png
The result image looks good, but the app is serving photos on demand and it
takes forever (upwards of 30 seconds for a 640x480 on my Mac). Turnaround
time is more important than image quality here, so I was wondering if anyone
had any ideas for how to speed this up? Here are a few ideas I had - no
idea if they would make a difference:
- linear gradients, as mentioned in the tutorial
- storing the gradient map
- using variable blur
mapping<http://www.imagemagick.org/Usage/mapping/#blur> by
creating two gradient:black-white squares to get something parametric-ish
Any help would be appreciated. Thanks!
-Aidan