Nepedia
Back to Discover
Advanced Reader
💻

SVG

technology Maturity 7-9 Next article →

Scalable Vector Graphics, or SVG, is an XML-based format for defining two-dimensional graphics. Unlike standard images that use a fixed grid of pixels, SVG uses mathematical descriptions to create shapes. This allows the graphics to be scaled to any size without losing quality or becoming blurry.

Bitmap VS SVG
Bitmap VS SVG

Because SVG files are stored as XML text, they are highly versatile. They can be searched, indexed, and compressed to save space. This format is an open standard managed by the World Wide Web Consortium (W3C). It is widely used in web design, printing, and mobile applications.

To build an image, SVG uses specific instructions to define various graphical objects. The system relies on three main types of objects: vector shapes, bitmap images, and text. Vector shapes are created using paths, which consist of straight lines or complex curves. These paths use commands like "M" for move to and "L" for line to, followed by specific coordinates.

SVG example markup grid
SVG example markup grid

Users can also define basic shapes such as rectangles, circles, and ellipses. Once these shapes are drawn, they can be styled with colors, gradients, or patterns. You can even use clipping paths or masks to control which parts of a shape are visible.

SVG offers many ways to add visual depth through painting and effects. Shapes can be filled with solid colors or complex gradients. A gradient can be linear, moving in a straight line, or radial, spreading out from a center point. Patterns can also be applied by repeating a specific graphic object across a surface. For more advanced work, the specification includes features like alpha masks for transparency and filter effects. These tools allow artists to create highly detailed and professional-looking illustrations.

Beyond static images, SVG supports interactivity and animation. Animation can be handled through a method called SMIL, which the W3C recommends for time-based changes. Alternatively, developers can use JavaScript to program how an image reacts to a user. This is done by accessing the SVG Document Object Model, or DOM. You can assign event handlers like "onclick" or "onmouseover" to any object. This means a shape can change color or move when a person clicks it or moves their mouse over it.

The history of SVG began with a period of intense competition. In 1998, six different groups submitted proposals for a vector graphics language. These included companies like Adobe, IBM, Microsoft, and Netscape. The W3C SVG Working Group, chaired by Chris Lilley, chose not to use any of these commercial versions. Instead, they developed a new, independent markup language. The first official version, SVG 1.0, became a W3C Recommendation on September 4, 2001. SVG 1.1 followed as a standard on January 14, 2003.

Different versions of SVG have been created to meet specific technological needs. For mobile devices with limited power, profiles called SVG Tiny and SVG Basic were developed. SVG Tiny was specifically designed for highly restricted devices like cellphones. In 2003, the 3GPP group made SVG Tiny the mandatory format for next-generation phones. More recently, the SVG 2 specification was developed to incorporate features from HTML5. SVG 2 reached the Candidate Recommendation stage on September 15, 2016. The latest draft for SVG 2 was released on September 14, 2025.

Efficiency is a major advantage of the SVG format. Because SVG files are XML-based, they contain many repeating text fragments. This makes them perfect for lossless data compression using the gzip algorithm. When compressed, these files use the .svgz extension.

20241229 Using concatenate function in spreadsheet to create SVG code - demo
20241229 Using concatenate function in spreadsheet to create SVG code - demo

An SVGZ file is typically 20% to 50% smaller than the original uncompressed file. This reduction in size helps websites load faster and saves data for users. This combination of scalability, interactivity, and small file size makes SVG a fundamental tool for the modern web.

622 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (3)
File:Bitmap VS SVG.svg
Bitmap VS SVG.svg
File:SVG example markup grid.svg
SVG example markup grid.svg
File:20241229 Using concatenate function in spreadsheet to create SVG code - demo.svg
20241229 Using concatenate function in...
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.