pxl8 is a simple command-line tool that turns images into pixel art with optional false-coloring using matplotlib colormaps.
Make sure you have Python 3.12+ installed, then install the required packages:
pip install pillow numpy matplotlibor with uv:
uv add pillow numpy matplotlibDownload the pxl8.py script or clone this repo:
git clone https://github.com/fuseraft/pxl8
cd pxl8Navigate to the directory containing the script and run:
python pxl8.py <image_path> [options]| Parameter | Description |
|---|---|
image_path |
Path to the input image |
--cmap CMAP, -c CMAP |
Colormap name (e.g. viridis, plasma), 'gray' or 'none' (default: none) |
--pixel-size N, -p N |
Pixel block size (default: 16) |
--out PATH, -o PATH |
Output file path (default: pixelized_output.png) |
--list-colormaps, -l |
List all available matplotlib colormaps and exit |
Basic pixelation (16px blocks, original colors):
python pxl8.py photo.jpgStrong pixelation with viridis colormap:
python pxl8.py selfie.jpg -c viridis -p 8Grayscale big pixels, custom output name:
python pxl8.py landscape.jpg -c gray -p 32 --out big-gray-landscape.pngList available colormaps:
python pxl8.py -lExample output of me dabbing on Diamond Head using the ocean colormap 🌊:
Contributions are welcome! Feel free to fork the repository and open a pull request with your improvements.
This project is open source and available under the MIT License.
