Expand description
This is a tool to transform images into Grids of ColoredGlyphs.
§Example
An image is processed by creating an ImageProcessingJob.
use glyphimg::image::Image;
use glyphimg::font::MonospaceFont;
use glyphimg::{ImageProcessingJob, BackgroundMode};
let image = Image::from_bytes(&img_bytes)?;
let font = MonospaceFont::from_bytes(font_bytes, 16)?;
let background_mode = BackgroundMode::Auto;
let job = ImageProcessingJob::new(
&image,
&font,
"abcdefghijklmnopqrstuvwxyz", // the glyphs to choose from
80, // the width, in glyphs, of the output grid
background_mode,
false, // whether to process the chunks in a random order
None // extra parameters for the color clustering algorithm
).ok()?;
let result = job.run(false, 1);Re-exports§
pub use crate::image::Color;
Modules§
- font
- Functionality for importing fonts into a format useable by glyphimg.
- grid
- Functionality related to the 2-D Grid data structure.
- image
- Functionality for importing images into a format fit for conversion into glyphs.
Structs§
- Colored
Glyph - Represents a glyph with a specific foreground Color and possibly a background Color.
- Image
Processing Job - An image processing job.
Enums§
- Background
Mode - Affects how a ColoredGlyph’s background color is generated.
- Processing
Error - An error that occurs during image processing.
- Processing
Event - Represents an event that occured during the running of an ImageProcessingJob.
Type Aliases§
- Listener
- An object capable of receiving ProcessingEvents.