Incorrect transformation into PNG (Black overlaying Boxes in PNG)
See original GitHub issueDescription
Convert an SVG into PNG leads into an PNG with black boxes overlay on other elements.
The PNG was made with “https://inkscape.org/” where those boxes are not visible.
Example data
Source SVG:
Source packed in ZIP: concept.svg.zip
Result PNG:
Screenshot Chrome Browser (Version 108.0.5359.125):
Screenshot Edge Browser (Version 108.0.1462.76):
Used Versions
- Svg.3.4.0
- Microsoft .NET V 6.0.12
- Win 10 Enter. / 21H2 / 19044.2251
Code snipped
private static string ConvertSvgToPng(string path)
{
// Create PNG Image from SVG-File
var svgDocument = SvgDocument.Open(path);
svgDocument.ShapeRendering = SvgShapeRendering.Auto;
svgDocument.FillRule = SvgFillRule.Inherit;
//svgDocument.FillOpacity = 1;
Bitmap bmp = svgDocument.Draw();
path = path.Replace(".svg", ".png");
bmp.Save(path, ImageFormat.Png);
return path;
}
Issue Analytics
- State:
- Created 8 months ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
PNG image's transparency overlaps a CSS background ...
The PNG image is the sidebar, and the black part is the CSS background, the PNG's alpha seems to override the black box....
Read more >PNG Image - Black only when in front of other objects
Where they are overlapping it has turned black again, because there are 2 transparent layers. You can imagine that using small values will ......
Read more >How to fix black background issue with PNG files in Photoshop
I am experiencing an issue with all transparent png files copied from Chrome and pasted into Photoshop CS6. The background is black rather...
Read more >Transforming a PNG element is causing a white box
I am brining a png file into PSE 13. After adding it to a layer, resizing, and rotating the image, I end up...
Read more >Weird extra gray box around transparent PNG in indesign
The areas where the PNG overlaps the gray shapes there is an additional gray box, that is close in size to the PNG's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i’m not sure what it did not read in the commits between the latest and my used version (3.4.0), i thought there was nothing done towards that case as far is i read the commits made.
It seems to me that the issue is any how fixed for the problem with the latest release.
With V3.4.4 i can not reproduce the error any more… Sorry for any inconvenience and thank you all for you’re quick reaction and help, I close the issue as i don’t need any more Help and the problem do not exist any more.
The following error is displayed in Development tool.