some useful snippet for image
Project description
pillow_snippet
some useful snippet and utils using pillow to handle image
Requirements
- Pillow
Install
pip install pillow-snippet
Documentation
Tutorial
- origin image
- convert an Image to a circled Image
from pillow_snippet import convert
origin_image = Image.open('colorful_example.png')
image = origin_image.resize((200, 200))
circle_image = convert.circle_image(image)
circle_image.save("test_result/circle_image.png")
- delete the white pixel from an image
it seems there is still white but if fact it is transparent. You can open the image in new tab to see more details
mask = Mask(image)
exclude_white_image = mask.get_exclude_white_image(tolerance=8)
exclude_white_image.save("test_result/exclude_white_image.png")
- convert the imge to only contains red color
mask = Mask(image)
change_to_red_image = mask.convert_to_single_color("#ff0000ff")
change_to_red_image.save("test_result/change_to_red_image.png")
Contribution
- clone the code
- make your commit
- make test
sudo pip install .
python3 test.py
- create a pull request
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
pillow-snippet-0.0.3.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for pillow_snippet-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98d9c60465232f7df3809205d7be67c051057504c5c2e39eefcba5a7a8ad8316 |
|
MD5 | 20ebedb0519724846659444186e936a4 |
|
BLAKE2b-256 | f43b1036d96101c105cb204f4aa415d1850bd105e5f24cd0bd5ff89ecea3d1f7 |