Dmytro developed the following script for Ubuntu:

#!/bin/bash
#
#

ly=${1:?Usage: $0 test[.ly]}

# strip extension, if any:
lynoext=${ly%%.ly}

# process test file:
echo "\\header { tagline = ##f }" | lilypond -dinclude-settings=- --png $ly

# trim PNG:
convert ${lynoext}.png -trim ${lynoext}-trim.png

# do we want to overwrite "original" PNG?
# mv ${lynoext}-trim.png ${lynoext}.png


This assumes you have imagemagick installed.

--
Phil Holmes


  ----- Original Message ----- 
  From: bart deruyter 
  To: [email protected] 
  Sent: Tuesday, July 19, 2011 2:37 PM
  Subject: rendering png without page


  Hi all,

  I'm using the latest stable verision of lilypond , 2.14.1. now creating the 
final version of my guitar book. I was wondering if it is possible to output 
.ly files to png's without page. I mean without white background, margins, 
etc.. files in which no white-space surrounds, or is within the score. I also 
mean, an output in which all white that is from the background is transparent. 
Only the score should be outputted. 

  I'd like this very much because then I can easily align the pieces of music 
as images within the text. Transparency would make it possible to use the 
output on differently coloured images too.

  Using svg as output can solve it partially, but I still need to resize the 
svg image to the piece of score, and in my opinion it's still a step too much. 
It does take too much time if it can be automated while rendering the png with 
a simple command line option, certainly in my case, having a large amount of 
small pieces of music for in an educational book.

  By the way, using lilypond --svg results in a ps... using lilypond -fsvg too, 
and only with -dbackend=svg I get an svg, on my system at least. Why making it 
so difficult? Stick to one option, makes it much easier.

  I used to use the framesets in scribus to render lilypond code, very usefull, 
and very handy, but after about 20 pages it takes too much rendering for 
scribus to handle. That's why I'd like to use png's.

  Greets,
  Bart Deruyter

  http://www.bartart3d.be/



------------------------------------------------------------------------------


  _______________________________________________
  lilypond-user mailing list
  [email protected]
  https://lists.gnu.org/mailman/listinfo/lilypond-user
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to