- Decoding from multiple image formats antagonistically while preserving image information (no implicit conversions)
- Support for some basic image processing functionalities (transformations, sobel, e.t.c)
- Support for conversion between image modes (RGB->Grayscale)
- Support for image filters (gaussian blur, sharpening)
- Support for image transparency
- Multiple depths and bit types(
f32
,u16
,u8
) - Support for
numpy
arrays (outputting image to numpy,creating an image from numpy array)
- The image library is performant with some processes taking advantage of multiple threads (e.g sobel uses multiple threads per channel)
- The routines are written in a safe and perfomant manner with care being given to ensure optimal assembly is generated for performance sensitive functions
- The library contains various benchmarks to compare it with other libraries (opencv, vips, image-rs), and internal benchmarks to keep track of operations.
- To build the library, you need the following
cargo/rust
: See https://www.rust-lang.org/tools/install for install instructionspython/pip
: See https://www.python.org/downloads/ for download and install instructions
- Clone the repo
git clone https://github.com/etemesi254/zune-image
- cd into the repo and into the zune-python repository
shell cd ./zune-image/zune-python
- Create a virtual environment for the repo
python -m venv .env
source .env/bin/activate
- Install maturin
pip install maturin
- Call
maturin build --release
This will build the project with optimizations turned
maturin build --release
Wait until you see
📦 Built wheel for CPython 3.11 to ./target/wheels/zune_image-0.4.0-cp311-cp311-manylinux_2_34_x86_64.whl
- Navigate to
{CRATE_DIR}/target/wheels/
- Call pip install with the local built package
pip install --force-reinstall ./zune_image-0.4.0-cp311-cp311-manylinux_2_34_x86_64.whl
- call
python
oripython
to get an interactive shell. - Import
zil
from there and decode an image
# Import the package
import zil
IMAGE_FILE = "image.png"
# Returns the image pixels as numpy
numpy_pix = zil.imread(IMAGE_FILE);
# or manipulate the image in Rust
im_rust = zil.Image.open(IMAGE_FILE);
# eg carry out sobel
im_rust.sobel()