Crop your image to different resolutions without missing the subject.
Project description
artdirector
Set a focal point and "artdirector" crop your image to different resolutions without missing the subject. Ideal to create images for mixed or responsive media.
Example
Original Image (by me)
Variants
artdirector --focus-x 260 --focus-y 440 --height 600 --width 600 --zoom 0.0 --edge 3.0 example.jpeg test-1.jpeg
artdirector --focus-x 260 --focus-y 440 --height 600 --width 300 --zoom 0.2 --edge 3.0 example.jpeg test-2.jpeg
artdirector --focus-x 260 --focus-y 440 --height 600 --width 600 --zoom 0.7 --edge 3.0 example.jpeg test-3.jpeg
Installation
pip3 install artdirector
Usage
Use it as a command-line tool:
$ artdirector --help
usage: artdirector [-h] [--width WIDTH] [--height HEIGHT] [--focus-x FOCUS_X] [--focus-y FOCUS_Y] [--zoom ZOOM]
INPUT_FILE OUTPUT_FILE
positional arguments:
INPUT_FILE Input image
OUTPUT_FILE Output image
options:
-h, --help show this help message and exit
--width WIDTH Crop width
--height HEIGHT Crop height
--focus-x FOCUS_X Focal point
--focus-y FOCUS_Y Focal point
--zoom ZOOM Zoom between 0.0 - 1.0 (0.0. Default)
--edge EDGE Edge (size/n) around the focal target area
As a Python module
from artdirector import ArtDirector
ad = ArtDirector()
ad.load('input.jpg')
ad.crop([400, 400], focus=[600, 300], zoom=0.3)
ad.save('output.jpg')
ad.filter_blur().filter_bw()
ad.save('output-blur-bw.jpg')
print(ad.image) # PIL Image
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 artdirector-0.0.3.tar.gz.
File metadata
- Download URL: artdirector-0.0.3.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f100d2ac7fb1d6a9b4c630a67dcb6fd3dfb396271a7fb1b1aa6cb85f4c60a46c
|
|
| MD5 |
cfc3b684dee3bdcffc844bef66248cbf
|
|
| BLAKE2b-256 |
2d87eb75741512649d39797c4a3177694267f9e26eadf59ca109c0ba82a17f84
|
File details
Details for the file artdirector-0.0.3-py3-none-any.whl.
File metadata
- Download URL: artdirector-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9ef3056819a617115279138f647de4d93181f0db130a004683539ea49ba3527
|
|
| MD5 |
e5c19358116a91f85afcbea7676eda3b
|
|
| BLAKE2b-256 |
a21e19aada80a7a65f39347798b9f78d609cf615c74df0d7a29b0bff4b0023af
|