CairoSVG icon indicating copy to clipboard operation
CairoSVG copied to clipboard

Strange artifacts when rendering patterns

Open martijnthe opened this issue 7 years ago • 3 comments

When converting SVG artwork to PDF with cairosvg, I noticed that strange artifacts appear in the rendering of <pattern>s. FWIW, the artwork was created with Adobe Illustrator CC 2017.1.

Output when using cairosvg cover.svg -o cover.pdf: cover-default-dpi

I noticed that reducing the --dpi option to a value of 1 makes the output reasonably acceptable. cairosvg cover.svg --dpi 1 -o cover.pdf: cover-1-dpi

The PDF file size in bytes grows only by 20KB or so, but the dimensions of the PDF are affected (~100x larger crop/media boxes when using --dpi 1 vs when using the default).

Surprising to me:

  • why does the rendering get better when the DPI value is lower?
  • why are the crop/media box dimensions of the PDF affected when changing the DPI (since DPI is a resolution unit, not a scale unit)?

I've attached the original .svg file so you can take a look. In case this is a bug, feel free to use it as a test case for the project: cover.svg.zip

martijnthe avatar Sep 17 '17 18:09 martijnthe

@liZe any ideas what the problem might be?

martijnthe avatar Sep 18 '17 20:09 martijnthe

I'll try to find the source of the problem as soon as poosible!

liZe avatar Sep 18 '17 21:09 liZe

@lize awesome thank you!

martijnthe avatar Sep 19 '17 06:09 martijnthe