Horizontalized scores

classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Horizontalized scores

Erik Linde
Hi, 

I am the creator of Notezilla, a popular (and fairly new) web application that allows users to both listen to classical music, as well as see a scrolling representation of the score that has been synced exactly to the recording. 

A big thing for us is being able to generate horizontal scores, ie scores where there are no line breaks or page breaks. This allows us and our users to enjoy a very constant visual flow of the music without skipping around too much. LilyPond is an integral component for us when it comes to generating these scores, as it is very important to us that the music looks and feels like "real" sheet music - this is one of the primary reasons for why we love LilyPond.

Typically the way we have been generating the images of the sheet music that we use on the website, is by setting some of the layout attributes to really large values, for example: 

ragged-last = ##t
paper-width = 2400.0\cm
paper-height = 50.0\cm

or perhaps 

#(set! paper-alist (cons '("my size" . (cons (* 2000 in) (* 50 in))) paper-alist))
#(set-default-paper-size "my size")

And then generating a pdf, which we then convert to images.

This works very well when generating a simple piece, such as a piano piece, but whenever there are multiple instruments, and when the piece is very long, such as is the case for most symphonies (which happen to be the most popular pieces on Notezilla), the time required to typeset a file seems to increase exponentially with the complexity of the music. 

For a symphony, it could easily go from a few minutes, when using a default layout, such as A4 or letter, to upwards of 10 hours, when using a custom paper format that is extremely wide, for example a 500cm or 1000cm in width. Please feel free to use this link to download the example that illustrates this - Beethoven's 3rd Symphony Mvt. 1. If I try running "lilypond ScoreMvtI.ly" in this example in a default layout, it takes maybe 10-15 minutes or so to typeset. If I uncomment row 27 and 28 (which is where I specify the *huge* paper size), it takes maybe 10 hours...

I am wondering if someone on this mailing list knows of any work-arounds or tricks that I could employ here to shorten the this time? The only requirements for us is that, in the end, that we get one long horizontal score, where the vertical spacing between the staffs is identical throughout the piece. Whatever method we can use to get there would be great to hear about! Maybe one way could be to split up the score into just 3-4 rows instead, and then merge these in Photoshop - my concern with that method would be that the vertical distances between staffs would probably not be identical, which would mean that the horizontal score simply would not work...

I look forward to hearing your thoughts! Thank you very much for all the work that has gone into LilyPond!

Best regards, 

Erik Linde
-----
Using a Mac Book Pro with 16GB RAM, 2.3GHz i7, Max OS X 10.9.1 + and LilyPond 2.18.0-1

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Horizontalized scores

Jay Anderson
On Fri, Feb 7, 2014 at 11:24 AM, Erik Linde <[hidden email]> wrote:

> Typically the way we have been generating the images of the sheet music that
> we use on the website, is by setting some of the layout attributes to really
> large values, for example:
>
> ragged-last = ##t
> paper-width = 2400.0\cm
> paper-height = 50.0\cm
>
> or perhaps
>
> #(set! paper-alist (cons '("my size" . (cons (* 2000 in) (* 50 in)))
> paper-alist))
> #(set-default-paper-size "my size")
>
> And then generating a pdf, which we then convert to images.
>
> This works very well when generating a simple piece, such as a piano piece,
> but whenever there are multiple instruments, and when the piece is very
> long, such as is the case for most symphonies (which happen to be the most
> popular pieces on Notezilla), the time required to typeset a file seems to
> increase exponentially with the complexity of the music.
>
> For a symphony, it could easily go from a few minutes, when using a default
> layout, such as A4 or letter, to upwards of 10 hours, when using a custom
> paper format that is extremely wide, for example a 500cm or 1000cm in width.
> Please feel free to use this link to download the example that illustrates
> this - Beethoven's 3rd Symphony Mvt. 1. If I try running "lilypond
> ScoreMvtI.ly" in this example in a default layout, it takes maybe 10-15
> minutes or so to typeset. If I uncomment row 27 and 28 (which is where I
> specify the *huge* paper size), it takes maybe 10 hours...
>
> I am wondering if someone on this mailing list knows of any work-arounds or
> tricks that I could employ here to shorten the this time? The only
> requirements for us is that, in the end, that we get one long horizontal
> score, where the vertical spacing between the staffs is identical throughout
> the piece. Whatever method we can use to get there would be great to hear
> about! Maybe one way could be to split up the score into just 3-4 rows
> instead, and then merge these in Photoshop - my concern with that method
> would be that the vertical distances between staffs would probably not be
> identical, which would mean that the horizontal score simply would not
> work...

Try this:

\paper {
  page-breaking = #ly:one-line-breaking
}

This should make the compilation much quicker. Also "\override
Score.NonMusicalPaperColumn #'line-break-permission = ##f" may be
useful.

-----Jay

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Horizontalized scores

Janek Warchoł
In reply to this post by Erik Linde
Hello,

2014-02-07 19:24 GMT+01:00 Erik Linde <[hidden email]>:
> Hi,
>
> I am the creator of Notezilla, a popular (and fairly new) web application
> that allows users to both listen to classical music, as well as see a
> scrolling representation of the score that has been synced exactly to the
> recording.

this looks very nice!  I haven't heard about it before.

I hope that Jay's suggestion worked for you.  Btw, you may find this
project interesting: https://github.com/aspiers/ly2video

best,
Janek

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Horizontalized scores

Erik Linde
In reply to this post by Jay Anderson
Hello Jay, 

Thanks for the tip, I tried it and it works wonders! Truly excellent, will save me enormous amounts of time :)

Lunch on me if you come to NYC!

Best, 

Erik

On Fri, Feb 7, 2014 at 6:36 PM, Jay Anderson <[hidden email]> wrote:
On Fri, Feb 7, 2014 at 11:24 AM, Erik Linde <[hidden email]> wrote:
> Typically the way we have been generating the images of the sheet music that
> we use on the website, is by setting some of the layout attributes to really
> large values, for example:
>
> ragged-last = ##t
> paper-width = 2400.0\cm
> paper-height = 50.0\cm
>
> or perhaps
>
> #(set! paper-alist (cons '("my size" . (cons (* 2000 in) (* 50 in)))
> paper-alist))
> #(set-default-paper-size "my size")
>
> And then generating a pdf, which we then convert to images.
>
> This works very well when generating a simple piece, such as a piano piece,
> but whenever there are multiple instruments, and when the piece is very
> long, such as is the case for most symphonies (which happen to be the most
> popular pieces on Notezilla), the time required to typeset a file seems to
> increase exponentially with the complexity of the music.
>
> For a symphony, it could easily go from a few minutes, when using a default
> layout, such as A4 or letter, to upwards of 10 hours, when using a custom
> paper format that is extremely wide, for example a 500cm or 1000cm in width.
> Please feel free to use this link to download the example that illustrates
> this - Beethoven's 3rd Symphony Mvt. 1. If I try running "lilypond
> ScoreMvtI.ly" in this example in a default layout, it takes maybe 10-15
> minutes or so to typeset. If I uncomment row 27 and 28 (which is where I
> specify the *huge* paper size), it takes maybe 10 hours...
>
> I am wondering if someone on this mailing list knows of any work-arounds or
> tricks that I could employ here to shorten the this time? The only
> requirements for us is that, in the end, that we get one long horizontal
> score, where the vertical spacing between the staffs is identical throughout
> the piece. Whatever method we can use to get there would be great to hear
> about! Maybe one way could be to split up the score into just 3-4 rows
> instead, and then merge these in Photoshop - my concern with that method
> would be that the vertical distances between staffs would probably not be
> identical, which would mean that the horizontal score simply would not
> work...

Try this:

\paper {
  page-breaking = #ly:one-line-breaking
}

This should make the compilation much quicker. Also "\override
Score.NonMusicalPaperColumn #'line-break-permission = ##f" may be
useful.

-----Jay


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Horizontalized scores

Erik Linde
In reply to this post by Janek Warchoł
Thanks Janek!

Jay's suggestion worked great. I've been talking with Adam as well and will dig into the ly2video project when I get a chance - could definitely be a lot of overlap with Notezilla!

All the best, 

Erik


On Sat, Feb 8, 2014 at 4:36 PM, Janek Warchoł <[hidden email]> wrote:
Hello,

2014-02-07 19:24 GMT+01:00 Erik Linde <[hidden email]>:
> Hi,
>
> I am the creator of Notezilla, a popular (and fairly new) web application
> that allows users to both listen to classical music, as well as see a
> scrolling representation of the score that has been synced exactly to the
> recording.

this looks very nice!  I haven't heard about it before.

I hope that Jay's suggestion worked for you.  Btw, you may find this
project interesting: https://github.com/aspiers/ly2video

best,
Janek


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

RE: Horizontalized scores

Chris Crossen-2
In reply to this post by Erik Linde
<base href="x-msg://2/">
 
From: [hidden email] [mailto:lilypond-[hidden email]] On Behalf Of Erik Linde
Sent: Friday, February 07, 2014 11:24
To: [hidden email]
Subject: Horizontalized scores
 
Hi, 
 
I am the creator of Notezilla, a popular (and fairly new) web application that allows users to both listen to classical music, as well as see a scrolling representation of the score that has been synced exactly to the recording. 
 
A big thing for us is being able to generate horizontal scores, ie scores where there are no line breaks or page breaks. This allows us and our users to enjoy a very constant visual flow of the music without skipping around too much. LilyPond is an integral component for us when it comes to generating these scores, as it is very important to us that the music looks and feels like "real" sheet music - this is one of the primary reasons for why we love LilyPond.
 

Erik,

Your site is very impressive.

I am also generating single, continuous line scores with Lilypond and am wondering what you use to extract your images from PDF.

I was originally using Adobe Acrobat and a plug-in to extract .png images from the .pdf. But, as you may have discovered, Acrobat has a 200-inch width limitation.

I am currently using Foxit Reader to view and check my very wide PDFs and GIMP-2 to extract the images from the PDF.

Do you mind telling me what you use?

Thanks,
Chris Crossen




_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Horizontalized scores

David Kastrup
Chris Crossen <[hidden email]> writes:

> I am also generating single, continuous line scores with Lilypond and
> am wondering what you use to extract your images from PDF.

What's wrong with lilypond --png here?

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

RE: Horizontalized scores

Chris Crossen
> From: lilypond-user-bounces+chris=[hidden email] [mailto:lilypond-
> user-bounces+chris=[hidden email]] On Behalf Of David Kastrup
> Sent: Wednesday, February 12, 2014 23:07
> To: Chris Crossen
> Cc: [hidden email]
> Subject: Re: Horizontalized scores
>
> Chris Crossen <[hidden email]> writes:
>
> > I am also generating single, continuous line scores with Lilypond and
> > am wondering what you use to extract your images from PDF.
>
> What's wrong with lilypond --png here?
>
> --
> David Kastrup
>
I can't get good looking images from --png. I may not have found the right
combination of parameters yet.


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Horizontalized scores

Janek Warchoł
2014-02-14 1:43 GMT+01:00 Chris Crossen <[hidden email]>:
>
>> What's wrong with lilypond --png here?
>
> I can't get good looking images from --png. I may not have found the right
> combination of parameters yet.

I suggest to try strokeadjust option if you haven't already.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

RE: Horizontalized scores

Chris Crossen
> From: Janek Warchoł [mailto:[hidden email]]
> Sent: Friday, February 14, 2014 9:47
> To: Chris Crossen
> Cc: David Kastrup; Chris Crossen; LilyPond Users
> Subject: Re: Horizontalized scores
>
> 2014-02-14 1:43 GMT+01:00 Chris Crossen <[hidden email]>:
> >
> >> What's wrong with lilypond --png here?
> >
> > I can't get good looking images from --png. I may not have found the
> > right combination of parameters yet.
>
> I suggest to try strokeadjust option if you haven't already.

Could someone suggest a good set of options for generating .png files that I can use as a starting point for experimentation?



_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Horizontalized scores

Noeck
>>>> What's wrong with lilypond --png here?
>>>
>>> I can't get good looking images from --png. I may not have found the
>>> right combination of parameters yet.
>>
>> I suggest to try strokeadjust option if you haven't already.
>
> Could someone suggest a good set of options for generating .png files that I can use as a starting point for experimentation?

I was quite happy with:

lilypond --png -danti-alias-factor=10 -dresolution=300 file.ly

An anti-alias-factor of 2 is not enough, IMHO. I don’t know other
options. “strokeadjust” that Janek mentions is only documented for
version 2.19 usage manual:
http://www.lilypond.org/doc/v2.19/Documentation/usage/command_002dline-usage.html

Cheers,
Joram


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

RE: Horizontalized scores

Chris Crossen
> I was quite happy with:
>
> lilypond --png -danti-alias-factor=10 -dresolution=300 file.ly
>
> An anti-alias-factor of 2 is not enough, IMHO. I don’t know other options.
> “strokeadjust” that Janek mentions is only documented for version 2.19
> usage manual:
> http://www.lilypond.org/doc/v2.19/Documentation/usage/command_002dli
> ne-usage.html
>
> Cheers,
> Joram

Is pngtopnm something I need to install on my Mac? Trying to run with the -danti-alias-factor option, I get:

Chriss-MacBook-Pro:data chriscrossen$ lilypond --png -dresolution=300 -danti-alias-factor=2 test.ly
GNU LilyPond 2.16.2
Processing `test.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `test.ps'...
Converting to PNG...
*** Warning: GenericResourceDir doesn't point to a valid resource directory.
               the -sGenericResourceDir=... option can be used to set this.

sh: pngtopnm: command not found

fatal error: GS exited with status: 32512


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Horizontalized scores

David Kastrup
"Chris Crossen" <[hidden email]> writes:

>> I was quite happy with:
>>
>> lilypond --png -danti-alias-factor=10 -dresolution=300 file.ly
>>
>> An anti-alias-factor of 2 is not enough, IMHO. I don’t know other options.
>> “strokeadjust” that Janek mentions is only documented for version 2.19
>> usage manual:
>> http://www.lilypond.org/doc/v2.19/Documentation/usage/command_002dli
>> ne-usage.html
>>
>> Cheers,
>> Joram
>
> Is pngtopnm something I need to install on my Mac?

Likely.  I think it's part of the ImageMagick suite.

> *** Warning: GenericResourceDir doesn't point to a valid resource directory.
>                the -sGenericResourceDir=... option can be used to set this.

That warning, however, looks like more of a Ghostscript misinstallation.

> sh: pngtopnm: command not found
>
> fatal error: GS exited with status: 32512

Interesting order of errors.  Almost looks like GhostScript would call
pngtopnm, but I don't think that's the case.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Horizontalized scores

Karl Hammar
David Kastrup:
> "Chris Crossen" <[hidden email]> writes:
...
> > Is pngtopnm something I need to install on my Mac?
>
> Likely.  I think it's part of the ImageMagick suite.

 pngtopnm is part of netpbm:

http://netpbm.sourceforge.net/
http://netpbm.alioth.debian.org/outside-debian.html

 For the mac, try:
http://pdb.finkproject.org/pdb/package.php/netpbm10
https://trac.macports.org/browser/trunk/dports/graphics/netpbm/Portfile
https://github.com/Homebrew/homebrew/blob/master/Library/Formula/netpbm.rb

Regards,
/Karl Hammar

-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57



_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

RE: Horizontalized scores

Chris Crossen
>
> David Kastrup:
> > "Chris Crossen" <[hidden email]> writes:
> ...
> > > Is pngtopnm something I need to install on my Mac?
> >
> > Likely.  I think it's part of the ImageMagick suite.
>
>  pngtopnm is part of netpbm:
>
> http://netpbm.sourceforge.net/
> http://netpbm.alioth.debian.org/outside-debian.html
>
>  For the mac, try:
> http://pdb.finkproject.org/pdb/package.php/netpbm10
> https://trac.macports.org/browser/trunk/dports/graphics/netpbm/Portfile
> https://github.com/Homebrew/homebrew/blob/master/Library/Formula/n
> etpbm.rb
>
> Regards,
> /Karl Hammar

Thank you all for the help I've been getting on my efforts to produce the .png images I want with Lilypond.

I am almost there. My current problem is that staff lines, measure bars, and note stems are being anti-aliased despite being perfectly horizontal or vertical. This makes them look fuzzy.

When I use GIMP to convert a pdf produced with Lilypond to a .png, I get nice crisp verticals and horizontals, no anti-aliasing. And, the note heads and other rounded parts are beautifully anti-aliased.

Does anyone know of a way to make Lilypond produce .png files with anti-aliased rounded parts and crisp straight lines?

Thank you all for your help.
Chris Crossen


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Horizontalized scores

David Kastrup
"Chris Crossen" <[hidden email]> writes:

> Thank you all for the help I've been getting on my efforts to produce
> the .png images I want with Lilypond.
>
> I am almost there. My current problem is that staff lines, measure
> bars, and note stems are being anti-aliased despite being perfectly
> horizontal or vertical.

There is no "despite" here.  If a line has a thickness of 1.5 pixels,
its weight can only be represented properly using grayscaling.  In a
similar vein, if a line position is between raster points, you need
grayscaling to move its position into the right place without changing
the total weight.

> This makes them look fuzzy.

Ultimately, the only thing that works for getting proper positioning,
thicknesses, unfuzziness is to match the distances to the available
pixels.  That's what
<URL:http://code.google.com/p/lilypond/issues/detail?id=3533> tries to
do, but it does not really catch all required measurements.

Alternatively, get a really high resolution device.  There are a few
changes one can do in the PostScript code (-dstrokeadjust is one such
change), but they come with different drawbacks and have different
effects depending on the rasterizers used.

Everything else is the tuning of rasterization compromises.  You can try
going through other rasterizers by working, say, with Acrobat on the
PostScript produced with LilyPond, or by going through the SVG backend.
And you can try playing with Ghostscript's options for converting
PostScript to PDF.

> When I use GIMP to convert a pdf produced with Lilypond to a .png, I
> get nice crisp verticals and horizontals, no anti-aliasing. And, the
> note heads and other rounded parts are beautifully anti-aliased.

I don't think that GIMP does anything but call Ghostscript for the
rendering (though I might not me up-to-date with my knowledge).  So this
would boil down to figuring out the options it uses.

> Does anyone know of a way to make Lilypond produce .png files with
> anti-aliased rounded parts and crisp straight lines?

LilyPond does everything by writing PostScript files.  PNG are produced
from there via Ghostscript, PDF via pdf2ps which just calls Ghostscript
with specific options.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

RE: Horizontalized scores

Chris Crossen
>> Chris Crossen:
> > When I use GIMP to convert a pdf produced with Lilypond to a .png, I
> > get nice crisp verticals and horizontals, no anti-aliasing. And, the
> > note heads and other rounded parts are beautifully anti-aliased.

> David Kastrup:
> I don't think that GIMP does anything but call Ghostscript for the
rendering
> (though I might not me up-to-date with my knowledge).  So this would boil
> down to figuring out the options it uses.
>

Thank you, David, for pointing me in the right direction. And thanks to
everyone who contributed to this thread for getting me this far along.

The trick to getting the crisp horizontal and vertical lines while still
getting anti-aliased curves is the ghostscript option -dGraphicsAlphaBits.
When Lilypond produces a .png file it set this to 4. If you set it to 1
instead, you get horizontal and vertical lines that aren't anti-aliased.

I have attached two images showing the difference. crisp.png was produced
with -dGraphicsAlphaBits=1 and blurry.png was produced with
-dGraphicsAlphaBits=4.

My current workflow uses Lilypond to produce a .pdf. Then I convert the .pdf
to .png with GIMP. I'm going to change this so that Lilypond produces a .ps
file that I convert to .png with ghostscript. I won't save any steps, but I
believe it will be faster and less error-prone.

Chris Crossen

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

crisp.png (3K) Download Attachment
blurry.png (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Horizontalized scores

David Kastrup
"Chris Crossen" <[hidden email]> writes:

>>> Chris Crossen:
>> > When I use GIMP to convert a pdf produced with Lilypond to a .png, I
>> > get nice crisp verticals and horizontals, no anti-aliasing. And, the
>> > note heads and other rounded parts are beautifully anti-aliased.
>
>> David Kastrup:
>> I don't think that GIMP does anything but call Ghostscript for the
> rendering
>> (though I might not me up-to-date with my knowledge).  So this would boil
>> down to figuring out the options it uses.
>>
>
> Thank you, David, for pointing me in the right direction. And thanks to
> everyone who contributed to this thread for getting me this far along.
>
> The trick to getting the crisp horizontal and vertical lines while still
> getting anti-aliased curves is the ghostscript option -dGraphicsAlphaBits.
> When Lilypond produces a .png file it set this to 4. If you set it to 1
> instead, you get horizontal and vertical lines that aren't anti-aliased.

Not just horizontal and vertical lines.  Also things like circles.  The
appearance of, say, { b\1 b\2 b\3 b\4 } is a downside to this approach.

I just remembered another option:

Convert to PDF with -dstrokeadjust and then convert PDF to PNG with
pdftocairo.  This approach is likely one of the slowest, but it's
basically what I used to batch-test what PDF previewers like Evince
would be likely to deliver.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

RE: Horizontalized scores

Chris Crossen
> >Chris Crossen:
> > The trick to getting the crisp horizontal and vertical lines while
> > still getting anti-aliased curves is the ghostscript option ->
dGraphicsAlphaBits.
> > When Lilypond produces a .png file it set this to 4. If you set it to
> > 1 instead, you get horizontal and vertical lines that aren't
anti-aliased.

> David Kastrup:
> Not just horizontal and vertical lines.  Also things like circles.  The
appearance
> of, say, { b\1 b\2 b\3 b\4 } is a downside to this approach.
>
> I just remembered another option:
>
> Convert to PDF with -dstrokeadjust and then convert PDF to PNG with
> pdftocairo.  This approach is likely one of the slowest, but it's
basically what I
> used to batch-test what PDF previewers like Evince would be likely to
deliver.
>

You're right. I tried your sample with my approach and see the problem.

Do you have any suggestions for options to use with pdftocairo?

I tried pdf2cairo -png input.pdf output.png

and the output wasn't anywhere near as good as what I see if I look at the
pdf with preview on my Mac.

It's frustrating that a PDF viewer does such a great job of rasterizing the
image and the only way I can get an equivalent .png is to take a screen shot
of it.

Chris Crossen


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

RE: Horizontalized scores

Tim Roberts
In reply to this post by Erik Linde
Chris Crossen <[hidden email]> wrote:
> The trick to getting the crisp horizontal and vertical lines while still
> getting anti-aliased curves is the ghostscript option -dGraphicsAlphaBits.
> When Lilypond produces a .png file it set this to 4. If you set it to 1
> instead, you get horizontal and vertical lines that aren't anti-aliased.
>
> I have attached two images showing the difference. crisp.png was produced
> with -dGraphicsAlphaBits=1 and blurry.png was produced with
> -dGraphicsAlphaBits=4.

But did you notice that the stems in your PNG are not all the same
thickness?  The G and A stems are 1 pixel, and the rest are 2 pixels.
Is that an acceptable trade-off for you?

--
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.


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