From the course: HTML: Images and Figures

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

SVG: The format for vector line art

SVG: The format for vector line art - HTML Tutorial

From the course: HTML: Images and Figures

Start my 1-month free trial

SVG: The format for vector line art

- [Instructor] The last format we'll discuss is one that's ideal for line art, SVG Scalable Vector Graphics. GIF, PNG and JPEG images are in Raster format. They treat the images a grid of individual pixels. If you take a PNG file and enlarge it by a factor of 300 percent, the browser has to expand the pixels, which gives the image a jagged, ugly look. SVG, however, doesn't store pixels. It stores images as a series of shapes to be drawn. The file consists of commands that tell the browser what geometric shapes to draw. It looks a lot like HTML. This example tells the browser to draw an ellipse and a rectangle with the specified positions, dimensions and styles. Here's what the enlarged portion of the airplane looks like when the SVG version of the drawing is enlarged. The browser is drawing the shapes with crisp edges no matter what sizes they're scaled to. That's the scalable part of SVG. This makes SVG a great choice for drawing icons and logos that have to look good at any size…

Contents