PepeCore
A Rust library for image decoding, encoding, and processing using an efficient SVec data structure.
PepeCore provides:
- SVec – high-performance, image buffers (
array::svec::SVec). - Image decoding – read images from file paths or in-memory buffers (
read::read_in_path,read::read_in_buffer). - Image saving – write
SVecimages to disk in common formats (save::svec_save). - Color conversions – dynamic RGB ↔ grayscale, YCbCr, CMYK, and channel swaps via
cvt_color. - Halftone effects – apply dot-based halftoning (
halftone,rotate_halftone). - Screentone effects – comic-style dot screening (
screentone,rotate_screentone). - (Experimental) Color levels adjustment – coming soon.
Installation
Add PepeCore to your Cargo.toml:
[]
= "0.1"
Then in your crate:
extern crate pepecore;
use ;
use ;
use ;
Quick Start
use ;
Features
Decoding
- Flexible input: file paths or raw byte buffers.
- PSD support: reads both layered and flattened PSD files.
- Dynamic types: returns either
u8,u16, orf32data.
Saving
- Handles
Luma,LumaA,Rgb,Rgbainu8,u16, andf32formats. - Converts floating-point to
u8with simple scaling (×255).
Color Conversion
Use cvt_color(&mut img, CVTColor::…) to:
- Convert between RGB, Grayscale (BT.601/709/2020), YCbCr, CMYK.
- Swap channels (RGB ↔ BGR).
- Expand Gray → RGB.
Halftone & Screentone
- Halftone dot screening with configurable dot sizes per channel.
- Rotate capability for angled halftones.
- Screentone for single-channel comic-style screening, with optional rotation.
Color Levels (Experimental)
The color_levels API is not yet fully implemented. Stay tuned for fine-grained black/white point and gamma adjustments.