Convert images to Excel pixel art and back
Project description
Excel Pixel Art
Convert images to Excel pixel art and back. Each cell becomes a pixel with its background colour matching the original image.
Installation
pip install excel-pixel-art
Or install from source:
git clone https://github.com/luigipascal/excelart.git
cd excelart
pip install -e .
Usage
Convert Image to Excel
image2xlsx photo.png
image2xlsx photo.png -o output.xlsx
image2xlsx photo.png --max-size 150
Options:
-o, --output: Output Excel file path (default:<input>_excel.xlsx)--max-size: Maximum dimension in cells (default: 100)
Convert Excel Back to Image
xlsx2image output.xlsx
xlsx2image output.xlsx -o recovered.png
xlsx2image output.xlsx --sheet Sheet1
Options:
-o, --output: Output image path (default:<input>_reconstructed.png)--sheet: Worksheet name to use (default: 'Image' if present, else active)--background R,G,B: Background colour for missing cells (default: 0,0,0)--no-autocrop: Disable auto-crop to solid-fill bounds
QA & Verification
# Compare with original for fidelity check
xlsx2image output.xlsx --compare original.png
# Generate visual diff heatmap
xlsx2image output.xlsx --compare original.png --diff-image diff.png
# CI pass/fail with threshold
xlsx2image output.xlsx --compare original.png --diff-threshold 5
Python API
from excel_pixel_art import image_to_excel, excel_to_image, compare_images
# Convert image to Excel
image_to_excel("photo.png", "output.xlsx", max_size=100)
# Convert back
excel_to_image("output.xlsx", "recovered.png")
# Compare for QA
compare_images("photo.png", "recovered.png", diff_output="diff.png", diff_threshold=5)
How It Works
-
Image → Excel: The image is resized to fit within
max_sizecells, maintaining aspect ratio. Each pixel becomes a cell with a solid fill colour matching the RGB value. -
Excel → Image: Cells with solid fills are read back, extracting their ARGB colour values. Auto-crop detects the actual pixel bounds, ignoring stray formatting.
-
QA Tools: The fidelity report compares reconstructed images against originals, with optional diff heatmaps and threshold-based pass/fail for CI integration.
Features
- ARGB colour handling - Proper Excel colour format (no transparency bugs)
- Fill caching - Fast generation even for images with thousands of unique colours
- Auto-crop - Ignores stray formatting outside the pixel grid
- Robust extraction - Handles both
fgColorandstart_colorpatterns - CI-friendly - Threshold-based pass/fail for automated testing
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file excel_pixel_art-1.0.0.tar.gz.
File metadata
- Download URL: excel_pixel_art-1.0.0.tar.gz
- Upload date:
- Size: 28.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0ee16dfc8cd8f18f8073abd92cfa495de426c950ddd835ba8f6b572903d8c6c
|
|
| MD5 |
6cf0155d8c9bc48572c3e0517b6a4d6f
|
|
| BLAKE2b-256 |
c2e7d8f0cf7ff1b6180d39f71d1c7061474d3fd969936c7bc3401e43234f9f04
|
Provenance
The following attestation bundles were made for excel_pixel_art-1.0.0.tar.gz:
Publisher:
publish.yml on luigipascal/excelart
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
excel_pixel_art-1.0.0.tar.gz -
Subject digest:
c0ee16dfc8cd8f18f8073abd92cfa495de426c950ddd835ba8f6b572903d8c6c - Sigstore transparency entry: 782207961
- Sigstore integration time:
-
Permalink:
luigipascal/excelart@4867757e411d08314c46cebe26bbd572696762c3 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/luigipascal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4867757e411d08314c46cebe26bbd572696762c3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file excel_pixel_art-1.0.0-py3-none-any.whl.
File metadata
- Download URL: excel_pixel_art-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9900461b96362c4896afe40f6316e44bcaf47fea0fb529e5e15512b38466b23d
|
|
| MD5 |
035b02c3c4a69890a9ed67c3538b4b3b
|
|
| BLAKE2b-256 |
6b0a97c45c4ff789f83433b50b32cf42104f0ea52fc19ba9771549e92f365a47
|
Provenance
The following attestation bundles were made for excel_pixel_art-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on luigipascal/excelart
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
excel_pixel_art-1.0.0-py3-none-any.whl -
Subject digest:
9900461b96362c4896afe40f6316e44bcaf47fea0fb529e5e15512b38466b23d - Sigstore transparency entry: 782207965
- Sigstore integration time:
-
Permalink:
luigipascal/excelart@4867757e411d08314c46cebe26bbd572696762c3 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/luigipascal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4867757e411d08314c46cebe26bbd572696762c3 -
Trigger Event:
release
-
Statement type: