rusty_raster: A tiny-skia Fork With unsafe Forbidden
rusty_raster 0.1.0 is a hardened fork of tiny-skia 0.12 with unsafe code forbidden. On 645 scenes rendered live against tiny-skia on three OSes, 641 match bit for bit.

What is rusty_raster?
rusty_raster is a 2D rasteriser with a tiny-skia-shaped API: anti-aliased fill and stroke with joins, caps, dashes and hairlines, gradients, blend modes, masks and pixmap drawing. It is a hardened fork of tiny-skia 0.12 with forbid(unsafe_code), its only dependency (rusty_png) is optional, and version 0.1.0 is on crates.io under Apache-2.0 and BSD-3-Clause.
rusty_raster 0.1.0 is a 2D rasteriser forked from tiny-skia 0.12, with unsafe code forbidden at the crate root. It keeps tiny-skia's API shape, so existing drawing code moves across with little change. On 645 test scenes rendered against tiny-skia live on Windows, Linux and macOS, 641 come out bit-identical, and the other four differ by at most one colour level.
A rasteriser turns shapes into pixels: a curve, a stroke with rounded joins, a gradient fill, a dashed line, a mask. tiny-skia is the well-known Rust port of the CPU half of Google's Skia, and it is good code. What rusty_raster changes is the guarantee. A fork that refuses unsafe can be audited by reading safe Rust alone, and that matters when the shapes come from a file someone else wrote, such as an SVG upload.
The crate ships from the remade_ffmpeg_rs monorepo and is on crates.io. Pin it from the rusty_raster repo page.
What the Fork Draws
Paths, strokes and paint
Fill and stroke are anti-aliased. Strokes support joins, caps, dash patterns, and hairlines for one-pixel lines that stay crisp at any scale. Paint can be a solid colour or a gradient, one pixmap can be drawn onto another, blend modes include the ColorDodge and ColorBurn modes mentioned below, and masks clip drawing to a shape.
Pixmaps in and out
Drawing happens into a pixmap, a plain pixel buffer you own. With the optional rusty_png feature, a pixmap can be saved as PNG or loaded from one, using the house rusty_png codec. Leave the feature off and the crate has no dependencies, which keeps it small for wasm or embedded builds.
What changed from tiny-skia
The API stays tiny-skia-shaped on purpose, so the work in 0.1.0 is underneath it. forbid(unsafe_code) is set for the whole crate, so the compiler rejects any unsafe block anywhere in it, and every line a reviewer reads is checked safe Rust. tiny-skia's BSD-3-Clause licence is kept. LICENSE-BSD-3-Clause and NOTICE.md ship inside the crate beside Apache-2.0, so anyone vendoring it carries the attribution with it.
Moving code across
Because the API keeps tiny-skia's shape, a port starts in Cargo.toml: replace the tiny-skia dependency with rusty_raster, update the use paths, and let the compiler point at anything whose name or signature differs. Then borrow the method described below. Render a handful of your own scenes with both crates on the same machine and compare the pixel buffers. If your drawings lean on ColorDodge or ColorBurn, expect the occasional one-level difference. Anything larger is worth reporting on the monorepo.
Testing Against a Library That Disagrees With Itself
Why stored digests failed
The obvious way to prove a fork is faithful is to render a corpus once with the original, store a hash of every image, and check the fork against those hashes. It cannot work for tiny-skia. Some of its drawing calls go through the platform maths library for functions such as acos, cos and powf. Windows, Linux and macOS ship different implementations, and they disagree in the last bit. So tiny-skia does not produce the same pixels on every operating system, and a single stored digest would fail somewhere no matter how good the fork was.
Render both, on the same machine
The test now renders each scene twice on the machine running it, once with tiny-skia and once with rusty_raster, and requires bit-identical output. The platform's maths library is the same for both runs, so any difference is the fork's doing. The corpus has 645 scenes and runs on Windows, Linux and macOS. On all three, 641 scenes match exactly.
The four that differ
The four scenes that do not match all use the ColorDodge and ColorBurn blend modes, and they differ by at most one level out of 255. Those two modes divide by a colour channel, which makes them the most sensitive to rounding order. A one-level difference is below anything visible, and it is written down here rather than rounded away.
Where rusty_raster Is Used
Drawing SVG
rusty_svgtree, released the same day, parses SVG into a render tree and draws it with rusty_raster. Icons, logos, charts and diagrams from untrusted SVG files reach pixels through two crates with no unsafe code between them.
Beside the other stills crates
Raster output often ends as a file. rusty_png writes PNG, rusty_jpeg writes JPEG, rusty_image handles BMP, TGA and QOI, and rusty_icc converts colour when the output needs a profile. All of them live in remade_ffmpeg_rs.
Thumbnails without a GPU
Server-side previews, chart images for reports, and generated cards for links are all CPU drawing jobs. Local tools such as RAG Converter render pages and previews on the user's own machine, and services on MATA.NETWORK run on hardware without a graphics card. Both are places where a rasteriser that is safe Rust from end to end fits without a GPU driver in the picture. For the background on Skia itself, see the Skia project.
FAQ
Quick answers for builders evaluating this technology.
How close is rusty_raster to tiny-skia's output?
On a 645-scene corpus rendered against tiny-skia live on Windows, Linux and macOS, 641 scenes are bit-identical. The remaining four use the ColorDodge and ColorBurn blend modes and differ by at most one level.
Why is rusty_raster licensed under two licences?
It is a fork, so it keeps tiny-skia's BSD-3-Clause licence alongside Apache-2.0 for the new work. The crate ships LICENSE-BSD-3-Clause and NOTICE.md so the attribution travels with it.
Why not store reference images and compare against those?
tiny-skia's own pixels differ by platform because it calls the system maths library for functions like acos, cos and powf, and those disagree in the last bit between operating systems. A stored digest could never pass everywhere, so the test renders both libraries live on the machine running it.
Does rusty_raster need any other crates?
No. Its only dependency is rusty_png, and that is optional, for reading and writing PNG pixmaps. Without it the crate builds with no dependencies at all.
What uses rusty_raster?
rusty_svgtree, the house SVG renderer, draws through it. Any program that needs to paint shapes, text outlines or charts into a pixel buffer without a GPU can use it directly.