Jump to content
andersius

SVG - How to avoid large file sizes using gradients/shadows

Recommended Posts

Hi

Using Gradients, or shadow effects dramatically increases the exported SVG file size. Do anyone have any tips/tricks for how to use gradients in a way that does not affect the file size? This is important for use on webdesign etc.

By example, a file was 4kb, without gradient. Introducing 1 gradient and 1 shadow effect resulted in a 60kb SVG file.

Anders

Share this post


Link to post
Share on other sites

Hi andersius,

Could you post the afdesign file?  I suspect some elements are being rasterised, like a layer Fx, which would explain for the increase in size

Share this post


Link to post
Share on other sites

Here is an example. By exporting this as SVG (Digital small size), without any effects gives a 9kb file.

By adding some "Outer shadow" to some of the elements, the SVG = 102kb.

I am not sure how I can control how whether or not these effects are being rasterized.

AD Test.afdesign

Share this post


Link to post
Share on other sites

Yes, the shadows are being rasterised. I had the same issue in Photo and the only way I could produce a vector blurred shadow (feGaussianBlur) was to replicate the shape, colour it black, offset a few pixels and apply a Gaussian blur from Fx.

Then export to svg with Rasterise set to Nothing. If it's left on Unsupported Properties then the svg has an embedded png. The rasterised blur is slightly larger but the unrasterised version is acceptable

Gradient_Shadow.afphoto


Microsoft Windows 10 Home, Intel i7-9750H CPU @ 2.60GHz, 16 GB RAM, 500GB SSD, 1TB Whirlygig, NVIDIA GeForce RTX 2060
Affinity Photo since 24/05/2020, currently 1.8.5.703

Share this post


Link to post
Share on other sites

I have a kind of similar problem with an inner shadow. When I don't do an inner shadow within the curve, the curve look sharp when I export the document to PDF. When I do an inner shadow, I guess the curve is being rasterized and the final PDF will have a curve with very unsharp edges. I cannot save the PDF with nothing rasterized, because then a lot of other things go wrong. Any solution to this?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.