Demorus
Demorus

Reputation: 159

Bigger SVGs better quality than smaller SVGs?

Do bigger svgs contain more detail than smaller svgs? I mean, is it better to export bigger svgs for the web or tiny ones? I know small ones load quicker and dont lose any quality when resized but just wanted to know if there are any disadvantages over bigger versions.

Upvotes: 2

Views: 147

Answers (4)

user3665322
user3665322

Reputation: 165

A few things affect the filesize of SVG, but they all have to do with the number, complexity, precision and redundancy of the information described therein. For example, rect x="100" y="200" width="200" height="300" and rect x="10" y="20" width="20" height="30" will be identical depending on the display size, even though the latter takes a four less bytes (if talking ascii) to specify. An SVG path, describing, say the boundary between China and Mongolia, that has 4000 coordinates in it (as the treaties defining those regions would probably specify) would be more bulky than one that only has 400 points, though the latter would be less precise. If the SVG is created by hand in a program like Illustrator or Inkscape, then there may often be redundancies in the output: gradients that are defined and never used, points that are specified several times within a path like d=" 0 0 0 0 100 100 100 100 ..." -- Inkscape has a way of simplifying the output so it has a little less cruft and there is a piece of freeware that has been around for a decade or so that can help remove such cruft. Also programs tend to output far more decimals of accuracy than most people or software would ever need, hence rendering the underlying geometry less accessible to the visually impaired: drawing a rectangle with precision in femto-meters is probably a bit of overkill and takes up space in the output. Basically, though the other folks who have responded are right, generally a square is a square is a square and on that takes up 50 bytes of storage is better than one that takes up 50 kilobytes of storage!

Upvotes: 0

refuzee
refuzee

Reputation: 408

It depends a bit I would say. As stated here:

This specification defines the features and syntax for Scalable Vector Graphics (SVG) Version 1.1, a modularized language for describing two-dimensional vector and mixed vector/raster graphics in XML.

  • If your export program compresses included/referenced raster images then you will have some quality decrease, of course.

  • For vectorgraphics only there might only be reduction in decimal places, which may be reduced up to a certain point without "visible" quality loss / change in detail.

  • If you have only vector graphics and do not change the decimal places then a smaller svg export of your graphic should only remove redundancy and compress the code.

An example of optimization for the last case can be found here and some more specific information here.

Upvotes: 3

Grapho
Grapho

Reputation: 1654

There is no difference in quality... big or small... the only difference you might be talking about is the amount of detail, which increases the actual file size and thus the loading time for the browser. But the quality will always be good, no matter what size it is.

Upvotes: 1

Günter Zöchbauer
Günter Zöchbauer

Reputation: 658087

SVG is vectordata the size you export doesn't influence the quality at all. You can it resize later and you will always have the best quality your output medium (screen) can provide.

Upvotes: 1

Related Questions