7

I was wondering why some of the SVG Filters found in Illustrator are automatically converted to PNG when I export the entire file to SVG. I don't want any hidden PNG files because of scalability.

To put it differently:

Why do some of the effects I create get rasterised, even though I'm working in a vector application with a vector file format?

5
  • Make sure the objects in question have SVG effects appearing last in the appearance panel. No other effects should follow.
    – cclark413
    Commented Apr 9, 2014 at 11:35
  • Thanks for the comment. I tried but still the same problem. The only thing I have under the effect I want to use (in the Appearance panel) is its Opacity which apparently can't be moved :/
    – hello_jo
    Commented Apr 9, 2014 at 14:37
  • 1
    Is this art 100% vector? No textures or placed files, and just the single opacity applied?
    – horatio
    Commented Apr 9, 2014 at 15:03
  • Yes, 100% vector. It has many layers but nothing placed from other files. The SVG Effect I'm using is the "GaussianBlur4". The element (a circle) with this effect is what turns into a .png when the entire file gets exported to .svg :/ So, what I get is an .svg file with a hidden .png inside. Thanks again for the help guys!
    – hello_jo
    Commented Apr 10, 2014 at 8:54
  • One way I have gotten around this, is by removing the filter, then editing the svg afterwards with a text editor, copying the filter back in. Its a work around, but I end up optimizing other things as well, so it works out.
    – mix3d
    Commented Jan 15, 2016 at 14:27

1 Answer 1

3

SVGs can reference other SVGs or images. When I tested SVG output from Illustrator (Illustrator CC 17.1.0), applying the SVG AI_GaussianBlur_4 to a circle object with a gradient fill resulted in only SVG markup in the file. I did this over, but this time applied a Drop Shadow and then the SVG AI_GaussianBlur_4. The code included an image. If I applied 2 SVG Filters onto the object, the SVG contained an image.

Based on this I would say:

  • If your file contains any effects that are not SVG Filters, and do require rasterization to take place (Stylize > Drop Shadow or any of the Photoshop filters) you're going to end up with an image embedded in the file.
  • If your file has more than one SVG filter applied to an object in it you're going to end up with an embedded image.

I would speculate that one or two things are the case, alone or in tandem:

  • The SVG plugin that Illustrator uses simply checks out and hands the artwork to the rasterizer and asks for a .png back any time it encounters more than one effect on an object.
  • In order to preserve the look of the artwork, especially considering browser variations, Illustrator rasterizes any object that has effects that are not specifically SVG or could render badly because of complexity and unaccounted for browser differences.

To test:

  1. Make a new file and draw a single object in it

  2. Make sure the object is selected

  3. Select Effect > SVG Filters… > AI_GaussianBlur_4

  4. Select File > Save

  5. Select SVG in the Format pulldown

  6. Click Save

  7. Click SVG Code…

  8. This will open a text file with the SVG markup in it. No embedded image.

  9. Go back to Illustrator and Cancel out of the Save dialog

  10. Undo the AI_GaussianBlur_4

  11. Select Effect > Stylize > Drop Shadow…

  12. Accept the default settings

  13. Select File > Save

  14. Select SVG in the Format pulldown

  15. Click Save

  16. Click SVG Code…

  17. This will open a text file with the SVG markup in it. It will have an embedded image.

I did various combinations of filters and objects using this method. I note:

  • Both a Stylize and the SVG filter to a single object = embedded image
  • Two SVG filters applied to a single object = embedded image
  • Two SVG filters, one applied to Object A, the second applied to Object B = NO embedded image
  • Three SVG filters, one applied to Object 1, and 2 applied to Object 2 = embedded image
1
  • it may also be that if 2 objects overlap, illustrator may need to rasterize if the other object can not be fully resolved otherwise.
    – joojaa
    Commented Jun 16, 2014 at 5:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.