7

I am trying to use Lilypond to generate (guitar) chord diagrams.

\include "lilypond-book-preamble.ly"
\version "2.16.2"

\markup {
  \vspace #1 
  \sans 
  \abs-fontsize #8 
  C   
}

\markup {
  \fret-diagram-terse #"x;3;2;o;1;o;"
}

Unfortunately the generated PNG is pretty small, just 121*133 px:

enter image description here

Can someone tell me how to make them like 500 px high?

2

It would appear that all that you really want is to render with a higher number of pixels. LilyPond renders its PNG images by default at a comparatively low resolution of 101dpi.

It sounds like calling lilypond with the -dresolution=400 option should do the trick for your problem. Note that LilyPond itself has various vector-class output options, like PostScript, PDF, or SVG. Using any of those should represent the output using B-splines, so you can use whatever tools you want on the corresponding output files to get bitmaps at arbitrary resolution. Which is pretty much what happens when using --png and -dresolution=... options.

0

I would try to take the encapsulated postscript (.eps) file generated by lilypond, and render it to PNG at the resolution/size you desire, as indicated in this SO question.

The 2.19 version has (some) control of the size of the chord diagrams (documentation here, I'm not sure when this feature was introduced), however using

\markup {
    \fret-diagram-terse #"s:2.0;x;3;2;o;1;o;"
}

in your test doesn't affect the size of the resulting png very much.

  • Just for the record, it could be done like so: convert -density 2000% *.pdf -resize x500 -background white -alpha remove -strip -quality 100 -set filename:f '%t' '%[filename:f].png' – marcus Apr 7 '15 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.