https://github.com/osfunapps/os_image_handler-py
This script contains fundamental image manipulation actions.
https://github.com/osfunapps/os_image_handler-py
graphics image image-processing python
Last synced: 9 months ago
JSON representation
This script contains fundamental image manipulation actions.
- Host: GitHub
- URL: https://github.com/osfunapps/os_image_handler-py
- Owner: osfunapps
- License: mit
- Created: 2020-03-25T14:51:45.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-07T14:03:48.000Z (over 5 years ago)
- Last Synced: 2025-03-23T04:45:12.123Z (over 1 year ago)
- Topics: graphics, image, image-processing, python
- Language: Python
- Size: 127 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Introduction
------------
This script contains fundamental image manipulation actions.
It is based on Pillow for Python.
## Installation
Install via pip:
pip install os-image-handler
## Usage Example
```python
from os_image_handler import image_handler as ih
# create a background canvas with a background gradient color
background = ih.create_new_image(1024, 500, None, '#FFC1B', '#FF881B')
# add text
ih.draw_text_on_img(background, 'Ball Game!', 20, 20, '#FFFFFF', '/Users/home/Library/Fonts/Consolas.ttf', 150)
# add the ball image
ball = ih.load_img('/Users/home/Desktop/icons/ball.png')
ball = ih.resize_img_by_width(ball, 250)
ih.paste_image(background, ball, 150, 200)
# add the happy lady image
happy_lady = ih.load_img('/Users/home/Desktop/icons/happy.png')
happy_lady = ih.resize_img_by_width(happy_lady, 250)
happy_lady = ih.tilt_image(happy_lady, 45)
ih.paste_image(background, happy_lady, background.width-happy_lady.width*0.7, background.height/2)
# save
ih.save_img(background, '/Users/home/Desktop/ball_game_img.png')
```

## Licence
MIT