#symmetry #8-bit #image #pixelation #graphics

bin+lib pixel8bit

A Rust library for applying 8-bit pixelation effects with symmetry detection and mirroring

3 releases (stable)

1.0.2 Nov 29, 2024
0.1.0 Nov 29, 2024

#385 in Game dev

Download history 113/week @ 2024-11-23 204/week @ 2024-11-30

317 downloads per month

MIT license

41KB
111 lines

👾 pixel8bit

Crates.io License: MIT Build Status Crates.io Downloads

pixel8bit is a Rust library and command-line tool that applies 8-bit pixelation effects to images, with optional symmetry detection and mirroring.

✨ Features

  • 8-bit Pixelation: Transform images to emulate classic 8-bit graphics.
  • Symmetry Detection: Automatically detect horizontal and vertical symmetry axes.
  • Mirroring: Mirror images around detected symmetry axes for artistic effects.

📦 Installation

To install pixel8bit, ensure you have Rust and Cargo installed. Then, run:

cargo install pixel8bit

🚀 Usage

After installation, you can use the pixel8bit command-line tool as follows:

pixel8bit <input_path> <output_path> <block_size> <is_mirrored>
  • <input_path>: Path to the input image file.
  • <output_path>: Path to save the processed image.
  • <block_size>: Size of the pixel blocks (e.g., 16).
  • <is_mirrored>: true or false to enable or disable mirroring.

Example:

To pixelate an image with a block size of 16 pixels and enable mirroring:

pixel8bit input.jpg output.jpg 16 true

🛠️ Library Integration

To use pixel8bit as a library in your Rust project, add the following to your Cargo.toml:

[dependencies] pixel8bit = "0.1.0"

Then, in your code:

use pixel8bit::pixelate::apply_pixelation;
use pixel8bit::symmetry::{detect_symmetry, mirror_image};

🖼️ Pixelation Examples

Block Size Result
Original Original Image
8x8 Pixelated Image (8x8)
16x16 Pixelated Image (16x16)
32x32 Pixelated Image (32x32)
64x64 Pixelated Image (64x64)

🤝 Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

📄 License

This project is licensed under the MIT License.

Dependencies

~5MB
~63K SLoC