A library to draw MDI icons onto PIL Image objects.
Project description
MDI PIL
This is a small library made to easily generate PIL Image objects of mdi
(Material Design Icon) icons. It also comes with a tool to convert user supplied image files into image objects that adhere to the main sizing principles of mdi icons.
There are also two additional functions, parse_weather_icon
and make_battery_icon
. The former returns a string with the mdi icon corresponding to a given weather condition. The latter creates an image that is similar to the icon showing the battery status in phones, with additional options like fill icons and the like. See the doc strings of those functions for how they work.
Examples
Make an PIL image object of the icon "mdi:test-tube" and open a window to show it:
from PIL import Image
import mdi_pil as mdi
icon = "mdi:test-tube"
img = Image.new("RGBA", (100,100), None)
img = mdi.draw_mdi_icon(img, icon, icon_color="steelblue")
img.show()
Convert the image file "speaker-outline.png" into an mdi-like icon:
from PIL import Image
import mdi_pil as mdi
img = "speaker-outline.png"
img = mdi.make_mdi_icon(img, 100, color="steelblue")
img.show()
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
File details
Details for the file mdi_pil-1.0.0.tar.gz
.
File metadata
- Download URL: mdi_pil-1.0.0.tar.gz
- Upload date:
- Size: 663.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aacfa51383d296911a54882dfa9ab5193d6047701cd61fbf48a517bf5ace78be |
|
MD5 | cfa2f51604425912852472ff8a164ef7 |
|
BLAKE2b-256 | 20ed6bdc917fa1e604a75ba8cb6605dbf8f71d602e1e8343bc6444d82083b2b5 |
File details
Details for the file mdi_pil-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: mdi_pil-1.0.0-py3-none-any.whl
- Upload date:
- Size: 660.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc6c180cb860eb0c44d9cffbcd9e4410e826fdb9784a273539864b602daaf860 |
|
MD5 | 76072eb72936af96b8d7deeb8cb9065c |
|
BLAKE2b-256 | 11755241cbe35f6fe3b01ca19adfc6fba716072c418f14deb3a76d2a69f3ad92 |