Pixelar
Show everyone the art hidden inside your code 🧁

Code for this piece of pixel art can be found here (It's a copy of a picture on pin).
What
Pixelar is a package that provides you simple API to create pixel arts using rust code.
-
The main purposes of this package is for Learning purposes and turning the code to something visual so it may become easier to understand.
-
It can also be used for creating unique pixel arts and FUN.
Dependencies
Pixelar uses imageproc and image from image-rs to create images.
Get Started
To quickly get started with the package, just bring our prelude into the scope and create a PixelPaper.
use *;
Note that constant generic numbers on pixel paper ( ::<10, 10> ). These're the height and width of your paper in pixels.
Here we have a 10*10 paper.
Now you can mutably access the pixels table on the paper and modify it.
use *;
You're given a 10*10 2D array of PixelDescriptor.
A PixelDescriptor, describes a pixel at the specified position. It's a simple enum with only two variants:
Now you can do whatever you want on the pixels.
// ---- sniff ----
let red = Pixel;
let green = ;
let blue = ;
let gray = 100; // (100, 100, 100)
table = blue.into;
table = red;
table = green.into;
table = gray.into;
// ---- sniff ----
You can turn anything that translates to an rgb code into a PixelDescriptor simply by calling into on it.
All pixels are PixelDescriptor::Nothing by default.`
Then finally save your art to a file.
// --- sniff ---
pixel_paper.save.unwrap
}
Run the code and check the result.

This was the whole idea! But there're more ...
use ;
Here's the result:

PixelBook
Pixel book is a collection of pixel papers and can be saved as a GIF.
use ;

Pixelar is a work in progress and it's not completed yet!