#icon #encode #decode


A robust, flexible Rust framework for creating encoders and decoders for various icon formats

17 releases

✓ Uses Rust 2018 edition

0.1.0-beta.16 Mar 18, 2020
0.1.0-beta.15 Mar 17, 2020
0.1.0-beta.12 Feb 20, 2020
0.1.0-beta.11 Dec 21, 2019
0.1.0-beta.2 Oct 28, 2019

#247 in Encoding

Download history 1/week @ 2020-01-21 1/week @ 2020-01-28 7/week @ 2020-02-04 16/week @ 2020-02-11 50/week @ 2020-02-18 55/week @ 2020-02-25 16/week @ 2020-03-03 14/week @ 2020-03-10 390/week @ 2020-03-17 51/week @ 2020-03-24 14/week @ 2020-03-31 56/week @ 2020-04-07 71/week @ 2020-04-14 10/week @ 2020-04-21 2/week @ 2020-04-28 19/week @ 2020-05-05

247 downloads per month
Used in 3 crates

MIT and MPL-2.0 licenses

521 lines


Crate API Minimum rustc version Downloads License

A robust, flexible framework for creating encoders and decoders for various icon formats.


Ikon is intended to be used as a framework for developers interested in creating encoders and decoders for various icon formats such as .ico files and favicon schemes. It does not come with any encoders or decoders out of the box.

Instead, it simply automates much of the hard work of encoding, decoding and resampling different image formats, as well as provides powerfull abstractions, allowing developers to concentrate on the more relevant problems.

Icon families are represented as maps between icons and images.The type of the icons of an icon is what determines how it can be indexed.


Each icon format is associated with a particular type of icon. The type of the icons of an icon family is what determines how it can be indexed. Each icon can only be associated with a single image.


Raster graphics are scaled using resampling filters, which are represented by functions that take a source image and a size and return a re-scaled image.

This allows the users of ikon and any of it's dependant crates to provide their custom resampling filters. Common resampling filters are provided in the resample module. The resample module also exposes the resample::apply function, which applies a resampling filter to an image and checks if the outputted result matches the dimensions specified by the filter's arguments.

Supported Image Formats

Ikon uses image for raster graphics manipulations and resvg with the raqote backend for svg rasterization.

Note that some file formats supported by image were explicitly left out of ikon because they were considered irrelevant to the library's domain.

Format Supported?
png All supported color types
jpeg Baseline and progressive
gif Yes
bmp Yes
webp Lossy(Luma channel only)
svg Static SVG Full 1.1

Build Requirements

Ikon relies on harfbuzz_rs, wich means CMake is required to be installed for it build.


Licensed under MIT license( LICENSE-MIT or http://opensource.org/licenses/MIT).


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be licensed as above, without any additional terms or conditions.

Feel free to help out! Contributions are welcomed 😃


~199K SLoC