PSSVG icon indicating copy to clipboard operation
PSSVG copied to clipboard

Render to PNG?

Open barcar opened this issue 2 years ago • 2 comments

Is there a way with this library to render the resulting SVG as PNGs of varying dimensions?

barcar avatar Jan 19 '23 07:01 barcar

You know, this is one of those this I wish were much easier than it is.

Long story made short:

Lots of engines can convert SVG to PNG.

Few do it "well", especially when it comes to advanced features.

The best fit I've found yet is using the browser source in OBS.

See:

https://obs-powershell.start-automating.com/2022/12/29/Rasterizing-SVGs-with-obs-powershell/

I've also looked at using FFMpeg to do this, but it's been very hard to find a Windows build with support for the needed libraries.

Trying to do direct rasterization isn't what I'd currently consider "in scope", because a good direct answer would be very expensive to build (in terms of time) and an indirect answer offers other advantages (like keeping it loosely coupled and not building out all of the customizations for rasterization within PSSVG, which is vector).

Please let me know if this helps you do what you need, and if you understand the rationale at play here.

StartAutomating avatar Jan 20 '23 03:01 StartAutomating

This is very helpful, thank you. It should be so much easier!

barcar avatar Jan 30 '23 11:01 barcar