-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird black and white lines in SVG rendering to PNG #299
Comments
The PDF output seems fine, so it looks like an issue with the reportlab bitmap renderer for which @replabrobin is the authority. Can you generate a minimal file showing this behaviour? |
Hi this is caused by our PM renderer backend based on libart_lgpl not coping with with complex paths. If you have a late model reportlab you can use a cairo based PM renderer which seems better. This involves 1) installing libcairo2 in the OS; then 2) pip install pycairo cairocffi rlPyCairo and finally 3) adding a settings override reportlab_settings.py (on the python path) and putting renderPMBackend='rlPyCairo' on a line in there. So far the only difference I have found is that the image pasting isn't identical. I have no idea if this can work on windows or OSX. |
There are an infinite number of other graphics renderers and probably we should be using AGG or SKIA, but those a AGG is unmaintained and SKIA is just vast. |
Also I have no real idea which is best pycairo or cairocffi; they both seem to use libcairo, but I just assumed cffi would be better as presumably it uses python + cffi rather than using a compiled extension. |
Before step 2) you need to follow https://stackoverflow.com/a/61164149/12579917 |
Just ran into this problem too. Scaling down some polygons to fit 256x256 results in very thin polygons in svg that stretch out to right end when converted to png. Here is a trivial example where the last path is displayed incorrectly after converting to png. I'm generating a few thousand svg's thta I convert into png's. most are fine but there are a few buggy ones like below.
|
Hi, thanks for making this library for all of us!
I'm trying to use your library to convert an SVG to PNG. When I try the simple code:
I get a lot of black and white lines in the PNG. I've attached both the source SVG and the generated PNG. I'm working on Windows, if that matters.
Here's the svg file:
svg.txt
Here's the PNG generated:
The text was updated successfully, but these errors were encountered: