lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: transparent background in lilypond generated png's


From: Wilbert Berendsen
Subject: Re: transparent background in lilypond generated png's
Date: Fri, 29 Aug 2008 08:10:34 +0200
User-agent: KMail/1.9.9

Op maandag 25 augustus 2008, schreef Gilles Sadowski:
>  $ convert test.png -transparent white test_tr.png

This will convert 'white' to '100% transparent', but not the shades of grey 
created by the anti-aliasing algorithms in ghostscript.

After long fiddling I found a way to convert every shade of grey to black with 
a corresponding percentage of transparency:

convert input.png \
        -trim -bordercolor white -border 3 \
        \( +clone -threshold 100% \) \
        \( -clone 0 -negate \) \
        -delete 0 -compose CopyOpacity -composite +repage output.png

- the first line crops the image and adds a border of 3 pixels
- the second and third line create to new images, one just black, the other 
with the colors negated.
- the last line deletes the first (original) image and copy the negated image 
to the alpha channel of a fully black image.

I use this to create LilyPond symbols for the menu actions in LilyKDE :-)

best regards,
Wilbert Berendsen

-- 
LilyKDE, LilyPond for KDE: http://lilykde.googlecode.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]