SVG export
Forum rules
Be kind.
Be kind.
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
SVG export
As one is able to export images in JPEG, PNG, and other bitmapped formats; surely it is a logical corollary to expect to be able to export vector objects as SVG files, and, even rnder text as SVG images?
https://richmondmathewson.owlstown.net/
- tperry2x
- Posts: 3210
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Somewhere in deepest darkest Norfolk, England
- Contact:
Re: SVG export
One for my wish-list too: I wonder how hard it would be to set a paint bucket 'threshold' so you can make it fill more similar areas.
- OpenXTalkPaul
- Posts: 2633
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: SVG export
There's two(+) different ways that SVG are supported.richmond62 wrote: ↑Sat Jun 29, 2024 2:11 pm As one is able to export images in JPEG, PNG, and other bitmapped formats; surely it is a logical corollary to expect to be able to export vector objects as SVG files, and, even rnder text as SVG images?
1) The SVG-Path Icon widget and some other widgets (most only use SVG's Path strings).
2) The Drawing Library and Image Control support for rendering (most of) SVG specification. This uses some format 'compiled SVG' binary data (which I believe is some optimized format from that is used by Skia rendering engine)
1) SVG-Paths can easily be wrapped in some XML to turn them back into valid SVG files.
There is a widget that can render addtional parts the SVG spec, most importantly the non-path-string shapes like rounded-rectangles, oval, etc (which matches up nicely to 'graphic control' styles. Widgets can also use fonts so I can't imagine why support for fonts specified in SVG tags was not implemented (in either method of support).
2) The problems with Drawing Library / Image Control SVG support are:
Doesn't support certain features of SVG, such as specifying Fonts/FontStyles and rendering Text data. To work around this, any text embedded into your artwork should be converted to outlines.
Unlike normal pixel data in an image control, there's no way to extract the data and return it to it's original file format. There's no 'DE-compiler' handlers for the optimized rendering data that gets it back to its original state. It's not pixel data being embeded in there, it is still resolution independent! If you try to use the paint tools on such an image control, you'll see that they don't work at all on an image control that has SVG data in it. To turn the image into actual pixels you can do a snapshot of the control of course, which you can then you can export to PNG,GIF,JPG, etc. That's not helpful if you want to edit art elements while keeping the art as resolution-independent vector-graphics.
- tperry2x
- Posts: 3210
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Somewhere in deepest darkest Norfolk, England
- Contact:
Re: SVG export
Yes, essentially you are rasterising the vector data by exporting and reimporting a snapshot (on a basic level), which destroys any vector data.
If you wanted to go the other way, back to vector - we are probably looking at some kind of image trace function? which is slow.
(Adobe Illustrator, Adobe Streamline, Artpro etc).
If you wanted to go the other way, back to vector - we are probably looking at some kind of image trace function? which is slow.
(Adobe Illustrator, Adobe Streamline, Artpro etc).
- OpenXTalkPaul
- Posts: 2633
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: SVG export
To go the other way, back to SVG vector from this optimized-binary SVG data in an image control, I think it would be best to find out what the format of this data actually is, then look at the render libraries, perhaps Cairo or Skia has a function that can already 'undo' this format and that just needs to be exposed to script engine (either via Engine modification or via FFI with XBuilder).tperry2x wrote: ↑Tue Jul 02, 2024 9:27 pm Yes, essentially you are rasterising the vector data by exporting and reimporting a snapshot (on a basic level), which destroys any vector data.
If you wanted to go the other way, back to vector - we are probably looking at some kind of image trace function? which is slow.
(Adobe Illustrator, Adobe Streamline, Artpro etc).
Another option is user could just keep the original SVG data in a custom prop set on the image control, of course that could potentially increaase the stack file size significantly.
Auto-tracers are great for generating rough vector graphics or even really tight vectors with a ton of points (maybe too many points), but I've never once used an auto-trace (Adobe 'Streamline' or whatever) generated vector graphic as-is, they always need manual clean-up. The best I've ever seen was something (can't remember Photoshop plug-in's name) that somehow used fractals instead of pixels and was very good at 'upscaling' low-res images into high-res images, and IIRC there was also an Adobe Illustrator vector-graphic plug in from the same people that used the same sort of algorithm.
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: SVG export
- Attachments
-
- vector2pdf_v02b.zip
- (25.24 KiB) Downloaded 40 times
-
- export_vector_to_ilustrator.zip
- (7.53 KiB) Downloaded 41 times
-
- export_regular_polygons.zip
- (2.49 KiB) Downloaded 41 times
https://richmondmathewson.owlstown.net/
Who is online
Users browsing this forum: No registered users and 0 guests