|
From: | Hans Aikema |
Subject: | PS to PNG transparency lost in conversion due to ghostscript-bug - possible workaround |
Date: | Sun, 01 Jan 2012 22:45:06 +0100 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 |
When GhostScript encounters a 'too large' bitmap it enters clist-mode rather than page buffer mode, which causes the tranparency to be replaced by solid white, loosing the transparency that lilypond put into the original postscript file.
I managed to circumvent this by patching my local lilypond installation (ps-to-png.scm) to always call gs with an additional argument -dMaxBitmap=2147483647 (max integer, the largest possible value gs will accept, which means it will process anything up to 2G using page buffer mode).
Given posts in the past on transparency not working without any solutions (apart from post-processing with other tools) I decided to share this one with the user-list. I think that my patch should not get into the default lilypond distribution, as it's a dirty trick to circumvent misbehaviour of GhostScript, but if you would like to apply this fix, just search for the line with
-dTextAlphaBits=4\in usr/share/lilypond/current/scm/ps-to-png.scm and add a line after that line containing
-dMaxBitmap=2147483647\to overrule the default GhostScript MaxBitmap with the maximum possible value
regards, Hans Aikema
[Prev in Thread] | Current Thread | [Next in Thread] |