I'm using dragonfly 0.9.15.
Given an image, I'm confused at how to use the convert method in dragonfly to crop a circular portion from the image with transparent background.
I am able to use a direct image magick command to run it from command line but the example command I found uses actual files and I'm unaware of how to get the file while dragonfly processes it on the fly.
Here's the actual command I took from a stack overflow post on imagemagick.
Command:
convert -size 200x200 xc:none -fill walter.jpg -draw "circle 100,100 100,1" circle_thumb.png
Now I tried to replicate the same with a convert in dragonfly.
require 'dragonfly/rails/images'
Dragonfly[:images].configure do |c|
c.job :crop_circle do
process :resize, "320x440"
encode :png
process :convert, '-virtual-pixel HorizontalTile -background transparent -draw "circle 400,400 400,1" -compose Copy_Opacity -composite'
end
end
How can I achieve this.
Any help is appreciated. The output I want is exactly same as what is there on the stackoverflow post I've mentioned.
Thanks,
Praveen.