| Crates.io | asvgard |
| lib.rs | asvgard |
| version | 0.2.3 |
| created_at | 2025-11-30 06:15:32.328532+00 |
| updated_at | 2025-12-09 04:59:03.952725+00 |
| description | High-performance SVG, PNG, and TGA rasterizer written in Rust |
| homepage | https://github.com/yourusername/asvgard |
| repository | https://github.com/yourusername/asvgard |
| max_upload_size | |
| id | 1957941 |
| size | 4,902,562 |
A Lightweight, Embeddable Vector Graphics Rasterizer
SVG β’ PNG β’ TGA β’ Pure Rust β’ Zero External Dependencies
Asvgard is a compact graphics rendering library designed for high-performance parsing and rasterization of SVG, PNG, and TGA formats.
Built with a focus on educational value and portability, it implements all decoding logic from scratchβincluding a full DEFLATE/zlib implementation and XML parserβavoiding the bloat of heavy external crates. This makes it uniquely suited for bare-metal environments, kernel development, and lightweight GUI applications.
image, flate2, or xml-rs. Every byte of logic is internal.viewBox scaling and centering.asvgard/
βββ src/
β βββ svg/ # XML Parser & SVG Tag Logic
β β βββ parser/ # Lexer and Tag Tree builder
β β βββ rasterizer/ # Scanline rasterizer & Filters (Blur, Offset)
β βββ png/ # DEFLATE decompressor & Filter reconstruction
β βββ tga/ # TGA Header parsing & RLE decoding
β βββ utils/ # Math, Transforms, and Compatibility layers
Asvgard provides a unified interface for loading images. It automatically detects the file format from the byte header.
use asvgard::prelude::*;
fn main() {
// 1. Load raw bytes
let data = include_bytes!("../assets/image.svg");
// 2. Define target resolution
let width = 800;
let height = 600;
// 3. Rasterize
// Returns a Result<Vec<u32>, String> buffer in 0xAARRGGBB format
match load_image(data, width, height) {
Ok(buffer) => {
println!("Successfully rendered {} pixels!", buffer.len());
},
Err(e) => eprintln!("Error rendering image: {}", e),
}
}
[dependencies]
asvgard = "0.1.0"
To use in a no_std environment, disable default features:
[dependencies]
asvgard = { version = "0.1.0", default-features = false }
Distributed under the MIT license.