Skip to content

SVG rasterizer, png not as expected #425

@andre2007

Description

@andre2007

I really do not have much knowledge about SVG. I write a D binding for Verovio (https://github.com/rism-digital/verovio) which is able to create Midi & SVG file for a given MusicXML file.

I attached the sample SVG file.
sample_svg.zip

In the webbrowser it is rendered like this:

image

When I use svg.d the PNG looks like this:
image

I used this coding and the svg.d from master:

  NSVG* image = nsvgParseFromFile("sample.svg", "px", 96);
    int w = 2000;
    int h = 4000;

    NSVGrasterizer rast = nsvgCreateRasterizer();
    auto img = new TrueColorImage(w, h);
    rasterize(rast, image, 0, 0, 1, img.imageData.bytes.ptr, w, h, w*4);
    image.kill();
    writePng("test.png", img);

Is there an error on my side or is maybe s.th. missing in svg.d?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions