dnfield / flutter_svg

SVG parsing, rendering, and widget library for Flutter
MIT License
1.66k stars 454 forks source link

Loading large size svg will not be smooth #380

Open jazzyyoung opened 4 years ago

jazzyyoung commented 4 years ago

hello dear, First of all, this is a great component that helped me a lot, thank you very much.And I drew a large svg ,with a size of 1024*1024 and about 512k [maybe will be larger in th future :)]. However, after loading this large-sized svg, zooming in and out with my fingers will not be smooth, how to deal with it Thank you again.

dnfield commented 4 years ago

This library was designed primarily with smaller, simpler SVGs in mind - particularly icons.

It should be possible to make that smooth, but I don't have plans to work on that anytime soon. I'd be happy to review PRs or design documents that suggested how to do it.

Reprevise commented 8 months ago

Hey @dnfield! How has this changed since vector_graphics is now the backend? I have this inconspicuous SVG here that is ~547kb. I used the vector_graphics_compiler to create a binary but that is still ~200kb. CS2 Skill Group 18

Right now, we're going to switch to using PNGs instead of an SVG for this, but I'd like to come back to it eventually. Is there any other way you think I could optimize this, especially for a scrolling list?

dnfield commented 8 months ago

Hey @dnfield! How has this changed since vector_graphics is now the backend? I have this inconspicuous SVG here that is ~547kb. I used the vector_graphics_compiler to create a binary but that is still ~200kb. CS2 Skill Group 18

Right now, we're going to switch to using PNGs instead of an SVG for this, but I'd like to come back to it eventually. Is there any other way you think I could optimize this, especially for a scrolling list?

This particular SVG is very detailed and would probably be better to ship as a raster asset.

Reprevise commented 8 months ago

This particular SVG is very detailed and would probably be better to ship as a raster asset.

We have shipped this as a WEBP for the time being (the 17 other rank SVGs too), and it's definitely way more compact at around ~40kb, and Flutter doesn't seem to have a problem with these. Thanks for the input!

Thanks to you and the team for making this, we use your package a lot in production in our app!