1

I use the folowing command to get preview images of my scores: lilypond -d preview -o preview/ my_file.ly

-d sets the output to the first line including titles
-o to select a different output directory

then I get three files:

my_file.preview.pdf
my_file.preview.eps
my_file.preview.png

the resolution of the png file is pretty low, while the resolution of the eps file is much higher and the pdfs resolution is somewhere in between.

Is it possible to:

  1. only get png files as output?
  2. and raise the resolution of those?

or would it be better practice to use some command line tool to just convert the eps files into png? (thinking of ImageMagicks convert or such)


I know that with the option:

 --png   you can generate pictures of each page, in PNG format.

and you can use:

-dresolution=110

to set the resolution, here to 110.

1 Answer 1

2

The PDF file is generated directly from the EPS file, as far as I know. EPS and PDF files generated by LilyPond don’t actually have a resolution, because EPS is a vector image file format that relies on paths instead of a pixel grid to display graphics. These paths can be scaled to any size without quality loss regarding resolution. The PDF file just contains the EPS file and should hence have the same quality.

If you only want to generate a PNG file, you can do this using the option -fpng, which should suppress the output of an EPS or PDF.

You can increase the resolution by setting a higher number to the -dresolution option, such as -dresolution=300 or you use even a higher value like 600 or even 1200. The value represents dpi (dots per inch), and 300 dpi is a fairly good resolution for printed matter.

Your complete command would then be:

lilypond -fpng -dresolution=300 -dpreview -o preview/ my_file.ly

See the documentation for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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