imagemagick - RMagick torn edges -
i'm trying create torn edge effect in rmagick. there filter similar photoshop's crystallize?
also, found imagemagick code here http://www.imagemagick.org/usage/thumbnails/#torn:
convert thumbnail.gif \ \( +clone -alpha extract -virtual-pixel black \ -spread 10 -blur 0x3 -threshold 50% -spread 1 -blur 0x.7 \) \ -alpha off -compose copy_opacity -composite torn_paper.png
however, don't understand of it. can provide advice?
this command 2 main things: create mask torn-paper effect, apply mask image. them, fancily, in 1 line, using +clone , parentheses. it's less confusing 2 commmands though:
convert thumbnail.gif \ -alpha extract \ -virtual-pixel black \ -spread 10 \ -blur 0x3 \ -threshold 50% \ -spread 1 \ -blur 0x.7 \ mask.png convert thumbnail.gif mask.png \ -alpha off \ -compose copy_opacity \ -composite torn_paper.png
the first command complex. can find decent explanations of each of component commands in imagemagick docs:
- http://www.imagemagick.org/usage/masking/#alpha_extract
- http://www.imagemagick.org/usage/misc/#virtual_examples
- http://www.imagemagick.org/script/command-line-options.php#blur
also, splitting command these 2 pieces, can see mask looks on own. it's inverse of paper effect. white throughout middle of images, fading black around "torn edges".
the second command lot more straightforward. copy_opacity, described in imagemagick docs, way of making parts of image transparent or not. that's black in mask made transparent in resulting image. in effect, second command uses mask "erase" edges of original thumbnail in stylistically interesting way.
Comments
Post a Comment