il logo svg

SVG

scalable vector graphic

icona per espandere il menu interno
Table of Contents

perché l'SVGSVG: why

La grafica vettoriale ha dei pregi, che la rendono preferibile alla grafica non-vettoriale in certe applicazioni. Non a caso il formato Flash, che è grafica vettoriale (proprietaria) ha ottenuto tanto successo. Uno dei pregi più vistosi è la leggerezza: a parità di dimensioni (ad esempio in pixel) una immagine vettoriale pesa molto meno, anche meno della metà di una immagine raster. Vector graphics have some strengths, which make it preferable to raster graphics in certain applications. It is no coincidence that the flash format, which is a vector (proprietary) graphics has achieved so much success. One of the most conspicuous strengths is lightness: with the same size (for example in pixel) a vector image weighs much less, even less than half of a raster image.

La grafica vettoriale SVG ha in più il pregio di essere uno standard w3c, dunque non proprietario, non commerciale, ma “aperto” (per maggiori dettagli In addition, the vector graphics SVG has the big advantage of being a W3C standard, therefore not owner, non -commercial, but "open" (for more details http://www.w3c.org/SVG/).

La possibilità di intervenire a livello del codice sorgente (testuale e “pulito”) rappresenta poi un grande vantaggio Moreover, the possibility of working at the level of the source code (textual and “clean”) represents a great advantage..

Dove la grafica vettoriale ha la sua più utile applicazione è a livello di schemi, diagrammi, o anche titoli di pagine da rendere con un formato più ricco di quanto non consenta l'HTML, senza però ricorrere a immagini raster Where the vector graphics have its most useful application is at the level of patterns, diagrams, or even pages titles to be made with a format richer than that allowed by simple HTML, without however using to raster images .

Altra applicazione è a livello scientifico, come quello astronomico (qui ne diamo un esempio), o chimico: può raffigurare immagini di grosse dimensioni con un peso in Kb molto contenuto e potendo venire ingrandita senza “sgranare”. Another field where svg can be useful is the scientific one, such as the astronomical one (here we give an example), or chemical: it can depict large images with a very low weight in KB and being able to be enlarged without “shelling”.

come fruire l'SVGSVG: how

Si può anche aprire una intera pagina web per visualizzarvi solo un file svg (lo facciamo ad esempio qui), ma il modo più opportuno di fruire di un SVG è di inserirlo all'interno di una pagina web, accanto a del testo, tipicamente You can open an entire web page to view just an svg file (we do it for example here), but the most appropriate way to use an SVG is to place it inside a web page, typically next to text.

Ci sono diversi modi per farloThere are several ways to do this:

  • incorporando l'SVG all'interno del codice sorgente di quella pagina (così da non rinviare a un file esterno)embedding the SVG within the source code of that page (so as not to link to an external file),
  • usando il tag <object>using the <object> tag,
  • usando il tag <img> (in effetti un SVG è una immagine)using the <img> tag (in fact an SVG is an image)

Il tag <object> è il sistema più diffuso, e non senza una ragione. Comunque i browsers standard-compliant riconoscono tutti e tre i metodiThe <object> tag is the most popular way, and not without a reason. However, standard-compliant browsers recognize all three methods.

In questa sezione

  • SVG in astronomy, a small-size, customizabile imageun'immagine leggera e personalizzabile: esempi di uso astronomico di svgsmall examples of astronomical use of svg files
  • Background SVG, an example: un semplice esempio di sfondo svga small example of svg as webpage background