lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Embedding images into a score created with -dbackend=svg


From: Valentin Petzel
Subject: Re: Embedding images into a score created with -dbackend=svg
Date: Sat, 27 Nov 2021 13:45:43 +0100

Hello Paolo,

I’m not saying that your approach is meaningless. Drawing paths as SVG and 
then transforming them into a Lilypond path is a sensible workflow for 
creating custom glyphs. But I’m just explaining why this would not work as a 
generic method for embedding SVG images into our score. And I’m saying that 
drawing from Lilypond to SVG and converting this into Lilypond draw commands 
again is probably most of the times unnescessary (although it might be useful 
if you change the output some way).

In your example the linked SVG does not exists, but if I replace it with an 
existing one like
https://jsfiddle.net/utxfgyLb/
I do not get any blur. Also if I’m using scale transforms on it I do not get 
any pixelation, as I’d expect on enlarging a rastered image. I’ve tried it on 
Firefox and on Konqueror/QtWebEngine (Chromium based).

So if this happens it should probably be considered a bug of the viewer. And 
we cannot try to have Lilypond circumvent any bug that might exist in some 
viewing software.

Cheers,
Valentin

Am Samstag, 27. November 2021, 12:28:32 CET schrieb Paolo Prete:
> On Sat, Nov 27, 2021 at 3:51 AM Valentin Petzel <valentin@petzel.at> wrote:
> > Hello Paolo,
> > 
> > The viewer needs to rasterize the svg, how else is it supposed to display
> > it?
> > Also it’s not you who is supposed to add the image tag, but the svg
> > backend.
> 
> Hello Valentin,
> 
> This is not what I meant. SVG embedded into an <image> tag gets rasterized
> regardless of its vector nature, thus producing a blurry or pixeled image
> after some transforms are done. Look at the blurry image of the fiddle
> inside the link of my previous message:
> 
> https://jsfiddle.net/godawnpL/
> 
> The embedded svg file is managed as a raster image and this is unwanted
> (then it's preferrable to inline the svg tree)
> 
> If you want to have a score in some markup, just do
> 
> > \markup { bla bla bla \score{ ... } bla bla }
> 
> And this is the answer I really required! Thanks!! I got crazy in the past
> days trying to create a markup with a fragment of score, and I did not know
> that this was possible (and so simple). I sent a message to the ml (
> https://lists.gnu.org/archive/html/lilypond-user/2021-11/msg00489.html )
> about the problem, few days ago, but did not get an answer with a working
> solution for it. Thanks again.
> 
> 
> There is nothing on this example page
> 
> > that would require importing anything.[
> > 
> > 
> > 
> > And the problem with your approach of turning an svg into a Lilypond path
> > is
> > than the lilypond drawing commands are significantly less powerful than
> > SVG.
> > So you cannot process all graphics files using your method.
> 
> Yes and no. I still think it's necessary for what I have to do. I have to
> create notes for contemporary scores, where it is very easy to have images
> around the fragment of the staff, in addition to the notes. Therefore I
> need a tool for making this kind of notes, where the "score" part is, let's
> say, 50%. Think for example at clarinet or flute scores, where multiphonics
> or special sounds together with special fingerings have to be used.
> Normally, an image of the instrument + fingerings + other special symbols
> has to be attached both in the score and into the notes on the initial
> pages. Of course there are some prebuilt objects for this (
> https://lilypond.org/doc/v2.22/Documentation/notation/woodwind-diagrams ),
> but I think it's much better to have a tool for making your custom images,
> because the shape of these symbols much depend on your particular score,
> there's not a shared standard. And these images require paths and nothing
> else, they are pretty simple: therefore the set of commands provided by LP
> cover completely their concrete drawing on SVG. Just pick a raster image as
> a model, then draw paths above its shape with Inkscape, then convert these
> paths to LP paths. Then my notes Will be a mixture of a \score part, as you
> suggested, and a "path" part made with the procedure I explained.
> 
> Best,
> Paolo

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]