This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in_pic = "in.jpg" | |
out_pic = "out.jpg" | |
radius = 25 | |
size = "500x500" | |
bgcolor = "white" #JPG doesn't support alpha channel, write "None" if you want transparent edges for PNG files | |
cmd = "convert #{in_pic} " + | |
"-resize #{size}! " + #comment out this line if you don't want to resize | |
"\\( +clone -alpha extract " + | |
"\\( -size #{radius}x#{radius} xc:black -draw 'fill white circle #{radius},#{radius} #{radius},0' " + | |
"-write mpr:arc +delete \\) " + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in_pic = "in.jpg" | |
out_pic = "out.jpg" | |
radius = 25 | |
size = "500x500" | |
bgcolor = "None" #JPG doesn't support alpha channel, write "None" if you want transparent edges for PNG files | |
cmd = "convert #{in_pic} " + | |
"-resize #{size}! " + #comment out this line if you don't want to resize | |
"\\( +clone -alpha extract " + | |
"\\( -size #{radius}x#{radius} xc:black -draw 'fill white circle #{radius},#{radius} #{radius},0' -write mpr:arc +delete \\) " + | |
"\\( mpr:arc \\) -gravity northwest -composite " + |