Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
desputin
Post
by desputin » 2010-02-13T13:26:00-07:00
Hi,
I'm working on a script for Imagemagick, in order to convert photos to comic-images. Up to now I have created the following script:
for x in *.png; do
convert -normalize -posterize 8 -despeckle -despeckle -despeckle -blur 1 -paint 2 $x $(basename $x .png)_comic.png
convert -posterize 9 -blur 18 -blur 4 -paint 3 -adaptive-sharpen 3 -edge 1 -negate -evaluate Multiply 1.5 -fx '(r+g+b)/3' +contrast -charcoal 1.1 -monochrome $x $(basename $x .png)_umriss.png
convert -transparent "#ffffff" -channel Alpha -evaluate Divide 1.5 -despeckle -paint 2 $(basename $x .png)_umriss.png $(basename $x .png)_umriss_trans.png
convert -paint 2 $(basename $x .png)_comic.png $(basename $x .png)_zusammen.png
composite $(basename $x .png)_umriss_trans.png $(basename $x .png)_zusammen.png $(basename $x .png)_final.png
rm -v *_comic.png *_umriss.png *_umriss_trans.png *_zusammen.png
done
I'm not quite satisfied with the result of this script...
Does anyone of you have suggestions to improve this script?
Best regards
Christopher
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2010-02-13T14:23:13-07:00
could you post a link of an input and output resulting image so others can try what you have done and see what you get and what changes can be made?
desputin
Post
by desputin » 2010-02-13T15:55:39-07:00
Hi,
sure. The convertet pictures you can find here:
http://www.christopherstark.de/extern/comic-effect.zip
Explanation of the script here:
// For Comic Effekt
convert -normalize -posterize 8 -despeckle -despeckle -despeckle -blur 1 -paint 2 picture.png comic.png
// Convert picture to Shapes
convert -posterize 9 -blur 18 -blur 4 -paint 3 -adaptive-sharpen 3 -edge 1 -negate -evaluate Multiply 1.5 -fx '(r+g+b)/3' +contrast -charcoal 1.1 -monochrome picture.png shapes.png
// Shapes to transparency:
convert -transparent "#ffffff" -channel Alpha -evaluate Divide 1.5 -despeckle -paint 2 shapes.png shapes_transparent.png
// compose shapes and image
composite shapes_transparent.png comic.png result.png