[][src]Crate iconwriter

A simple solution for generating .ico and .icns icons. This crate serves as IconWriter CLI's internal library.

Usage

use iconwriter::prelude::*;
 
const N_ENTRIES: usize = 1;
 
fn main() {
    // Creating the icon
    let mut icon = Icon::ico(N_ENTRIES);
 
    // Importing the source image
    let src_image = SourceImage::from_path("img.jpg").unwrap();
 
    // Adding the sizes
    icon.add_sizes(&vec![32, 64], &src_image).unwrap();
}

Supported Image Formats

FormatSupported?
PNGAll supported color types
JPEGBaseline and progressive
GIFYes
BMPYes
ICOYes
TIFFBaseline(no fax support), LZW, PackBits
WEBPLossy(Luma channel only)
PNM PBM, PGM, PPM, standard PAM
SVGLimited(flat filled shapes only)

Re-exports

pub extern crate nsvg;
pub use nsvg::image;

Modules

prelude
resample

Structs

Icon

A generic representation of an icon.

Enums

Error
IconType
SourceImage

A representation of a bitmap or an svg image.

Traits

FromPath

Trait for constructing structs from a given path.

Type Definitions

Result
Size