Visualize group data by filling images with color proportions.
Project description
Fillwise 
Visualize group data by filling images with color proportions.
Fillwise is a Python module for visualizing group data by filling images with color proportions. It can be used for custom charts, data art, and creative data storytelling.
Usage
pip install fillwise
import pandas as pd
from fillwise import Fillwise
# Sample data
df = pd.DataFrame({
"Fruits": ["Apple", "Banana", "Cherry"],
"Counts": [20, 35, 45]
})
# Usage of Fillwise
fw = Fillwise(df, mask_path="cart.png", fill_style="horizontal")
# Save
fw.save("output.png")
# Display using system default image viewer
fw.show()
| Before | After |
|---|---|
Sample image credit from UXWing. The data presented here are made-up only.
Fillwise Output with Matplotlib
# Usage of Fillwise
fw = Fillwise(df, image_path=image_path, fill_style="radial")
image = fw.render()
# Sample Plotting
fig, ax = plt.subplots()
ax.imshow(image)
ax.axis("off")
patches = [mpatches.Patch(color=color, label=label)
for color, label in zip(fw.colors, fw.labels)]
ax.set_title("Game Genre Preferences",
fontweight='bold', fontsize=16)
ax.legend(handles=patches, loc="center left", bbox_to_anchor=(1, 0.5),
frameon=True)
plt.tight_layout()
plt.show()
Sample image credit from UXWing. The data presented here are made-up only.
Fill Styles
Fillwise supports multiple fill styles to suit different image shapes and storytelling needs:
| Style | Description | Best For |
|---|---|---|
horizontal |
Fills left to right | Wide images like carts |
vertical |
Fills top to bottom | Tall silhouettes |
radial |
Fills outward from the center | Symmetrical shapes |
You can switch styles by setting fill_style="..." when creating a Fillwise instance.
Image Masks
You can use any transparent PNG image as a mask. Fillwise fills only the visible (non-transparent) pixels.
fw = Fillwise(df, image_path="your_mask.png", fill_style="horizontal")
License
This project is licensed under the MIT License. See the LICENSE file for details.
Attribution
Images used in examples are credited to UXWing.
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 fillwise-1.0.0.tar.gz.
File metadata
- Download URL: fillwise-1.0.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40887957d4d7fe03f5acb6f8c8b543d7be444d8d6438fe489b6cb7853eea74c3
|
|
| MD5 |
056cc64fcefd15e3fdfada13b4cb3e06
|
|
| BLAKE2b-256 |
c46bb267bb19223236c981e9f2162d54dc4158dabdea3c181104ccf0e752e36c
|
File details
Details for the file fillwise-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fillwise-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1a952089f30d87bd1a82b65a3e023d6ef3c9e0b8cdbfbd16d5df44019370506
|
|
| MD5 |
8da6f6567c383805c852fc2acbf28856
|
|
| BLAKE2b-256 |
faaf35ac7c907b96c57ae53be028e44251379d128a6eb7d78d936c75cea5a378
|