Skip to main content

Visualize group data by filling images with color proportions.

Project description

Test Fillwise on macOS, Linux, and Windows PyPI Python License

Fillwise Fillwise Icon

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.


Buy Me a Coffee

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
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()
Matplotlib Sample

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fillwise-1.0.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fillwise-1.0.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file fillwise-1.0.1.tar.gz.

File metadata

  • Download URL: fillwise-1.0.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for fillwise-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5f6383381a1d220b26ce74b9600a620f6389b457d509eb962ee6bcd83771fb7c
MD5 fe6b6db0a6067d1329e98d8e47e34a96
BLAKE2b-256 c9c07599a6f3a24e4ef8d7610a719138368a55f93d6fbda8b2fd887f202429fe

See more details on using hashes here.

File details

Details for the file fillwise-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: fillwise-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for fillwise-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2452175bfc2c0acd9f8f78bd3d69e166c40abb0d381c8ff337cff6bce3659229
MD5 df1e66fb6323620a82ebbf7c984260b9
BLAKE2b-256 4bf3c1fa12f589b4f2f41d7d29b69424658602cc60dec58be3007593f6d4491f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page