Vanilla is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthortliff
    • CommentTimeSep 19th 2009 edited
     permalink
    I am trying to outsource a little programming to our users. So if you have some spare time and want a challenge, try it out. ;)
    What i need is a way to take an image like this:



    and remove the white border around it. Also the white space in the rounded corners and make it a transparent .png
    After that it should look good on a dark background.

    Idealle this would be done in Ruby using http://rmagick.rubyforge.org/
    If you don't know Ruby and still want to help out, you can also try it in php http://us3.php.net/manual/en/book.imagick.php or basically other languages http://www.imagemagick.org/script/index.php (I'll be able to translate that)

    If you have any questions, just ask here or on the IRC-channel #whatthemovie on quakenet irc://irc.quakenet.org/whatthemovie
    •  
      CommentAuthorefji
    • CommentTimeSep 19th 2009
     permalink
    Hi tliff,

    using ImageMagick, I can get quite easily something like that: http://cjoint.com/data/jtqS6kNnVt.htm
    with too main flaws: bad antialiasing around the picture, and some parasite transparencies inside.

    I used a script called "autotrim" that you can find here:
    http://www.fmwconcepts.com/imagemagick/downloadcounter.php?scriptname=autotrim&dirname=autotrim
    and the following commands starting from wtm.jpg as original image and calling wtm_transp.png
    the final output:

    autotrim -f 30 wtm.jpg wtm.png

    convert wtm.png \( +clone -fx 'p{0,0}' \) \
    -compose Difference -composite \
    -modulate 100,0 +matte difference.png

    convert difference.png -threshold 4% wtm_mask.png

    convert wtm.png wtm_mask.png \
    +matte -compose CopyOpacity -composite \
    wtm_transp.png
    •  
      CommentAuthortliff
    • CommentTimeSep 19th 2009
     permalink
    I should have mentioned in the original post that we are pallning on using the resulting images on a dark background which makes the flaws a bit worse
    •  
      CommentAuthorefji
    • CommentTimeSep 19th 2009
     permalink
    I had understood that :)

    This script should do the job with anti aliasing and no internal pollution:
    http://www.imagemagick.org/Usage/scripts/bg_removal

    but I was not able to run it with my version of Imagemagick, which is ideed quite recent. It
    stops on an error message "convert: unrecognized option `-sparse-color'".
    Maybe you can try it.