[][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
JPEG1seline 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;
pub use crate::ico::Ico;
pub use crate::icns::Icns;
pub use png_sequence::PngSequence;

Modules

icns
ico
png_sequence
prelude
resample

Structs

SvgImage

Enums

DynamicImage

A Dynamic Image

Error
SourceImage

A representation of a bitmap or an svg image.

Traits

FromPath

Trait for constructing structs from a given path.

GenericImage

A trait for manipulating images.

Icon

Type Definitions

Result
RgbaImage

Sendable Rgb + alpha channel image buffer

Size