Premiers pas en SVG
[20 mn de lecture - paru le 12/8/2006 12:17:26 AM - Public : Débutant]
|
   
|
Auteur
1 Systems of chart
The two principal systems to represent graphic information on computer are the vectorial graphs bitmap and graphs.
1.1 Bitmap graphs
An image is consisted a whole of elements called pixels. Each pixel
represents a color by its components Red-Green-Blue or an index in a
list of colors. This series of pixels, also called bitmap is often
stored in a compressed form. As the majority of the peripherals of
posting are peripherals of the bitmap type, post an image requires on
behalf of the program in load of posting only to decompress it and
transfer it towards the screen.
1.2 Vectorial graphs
An image is described by a whole of geometrical forms. Instead of
receiving the image already built in the form of pixels, the program of
visualization receives orders which will enable him to trace forms with
precise co-ordinates.
If one tries to produce an image on paper squares, the method bitmap
consists in determining which colors to allot to the squares of the
grid, whereas the vectorial method consists in describing by which
points must pass the lines or the forms which make the drawing. It is
often said that the vectorial graphs are a whole of instructions of
drawing whereas the graphs bitmap are a whole of coloured points. The
vectorial graphs “know” what they are, a square “knows” that it is a
square and a text “knows” that it is text. Because they are not that a
series of pixels, the vectorial objects can vary their form or their
color, whereas the graphs bitmap cannot it. In the same way, one can
seek character strings in a vectorial text, even if it underwent a
rotation or a transformation.
Another way of seeing the graphs bitmap is like a painting on a fabric,
the vectorial graphs like lines and the made shapes of a ductile
material, placed on a bottom of page.
1.3 AdaptabilityAlthough they are not as widespread as the
graphs bitmap, vectorial graphics have a characteristic which makes
them essential in many applications: they can be increased without loss
of quality. To illustrate this, here two drawings of a cat. Figure 1
was created with graphs bitmap, figure 2 with a vectorial
representation.
Both are shown such as they appear on a screen of which the resolution is of 72 pixels per inch.
When a program of posting makes a zoom on a portion of the graph
bitmap, it must find a way of increasing each pixel. The simplest
approach for zoomer of a factor 4 is to duplicate each pixel 4 times.
Although it is possible to use methods such as detection of contour and
the antione to improve the image, these techniques are very expensive
in computing times. Moreover, as nothing makes it possible semantically
to distinguish a pixel from another, one cannot guarantee that an
algorithm can correctly detect contours of the forms.
On the other hand, to increase a vectorial image of a factor 4 does not
require anything more than to multiply the co-ordinates of the objects
by 4 and to redraw these objects with the final resolution of the
peripheral. Figure 3, which is also a capture of screen having 72
pixels per inch, shows how the lines are clear with much less effects
of staircases than on the increased image bitmap (figure 4).
1.4 Role of SVGIn 1998, the World Wide Web Consortium
initiated a working group with an aim of defining a vectorial language
in the form of application XML. As SVG is an application XML,
information on an image is stored in textual form and it inherits
naturally the advantages of XML like the opening, the portability and
interworking.
As the programs of CAD and illustration use formats owners to store
their drawings, the possibility of importing and of exporting in SVG
allows them a greater interworking.
SVG cooperates naturally with dautres applications of XML. A work of
mathematics, for example, can use XSL Formatting Objects for the text,
MathML to describe the equations and SVG to create the graphs.
The specification of the working group SVG is an official
recommendation of the World Wide Web Consortium. Certain applications,
like Adobe Illustrator and WebDraw de Jasc export their drawings in
SVG. On the Web, plugins SVG for navigators make it possible to post
presentations with the same level of interactivity and animation which
Flash allows. As files SVG are XML, a user knowing to exploit the XML
will be able to also benefit from the text contained in the SVG.
|