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.output('input.jpg')
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
artdirector-0.0.2.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for artdirector-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab9b2a64947507b043027265ecb2a776b4c8ffa3f2231a12b79f62370e7284ae |
|
MD5 | ebca8b21924ed2d7bcae86ecfb26cf59 |
|
BLAKE2b-256 | ad0b5fe688ffde13845e414eca0decbfd5720f4be3863cee7ff7d94c0f7875ec |