Python utility to add borders to my photography pictures
Project description
colorframe
A simple package to add colored borders on pictures.
Install
This code is compatible with all currently supported Python versions. It can be installe in a virtual enrivonment with:
python -m pip install colorframe
Usage
With this package is installed in the activated enrivonment, it can be called through python -m colorframe
.
Detailed usage goes as follows:
Usage: python -m colorframe [OPTIONS] [PATH]
Add colored borders on pictures, easily.
╭─ Arguments ─────────────────────────────────────────────────────────────────────────────╮
│ path [PATH] Location, relative or absolute, to the file or directory of files │
│ to add a colored border to. │
│ [default: None] │
╰─────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────────────────────────────╮
│ --left INTEGER Width of the frame to add on the left image edge. │
│ [default: 0] │
│ --right INTEGER Width of the frame to add on the right image edge. │
│ [default: 0] │
│ --top INTEGER Height of the frame to add on the top image edge. │
│ [default: 0] │
│ --bottom INTEGER Height of the frame to add on the bottom image │
│ edge. │
│ [default: 0] │
│ --color TEXT The desired color of the added border. Should be a │
│ keyword recognized by Pillow. │
│ [default: white] │
│ --log-level TEXT The base console logging level. Can be 'debug', │
│ 'info', 'warning' and 'error'. │
│ [default: info] │
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it │
│ or customize the installation. │
│ --help Show this message and exit. │
╰─────────────────────────────────────────────────────────────────────────────────────────╯
The script will crawl files, add borders and export the results in a newly created outputs
folder.
You can otherwise import the high-level object from the package, and use at your convenience. For instance, to add a blue border of 150px on the left and 72px on the bottom of all images in a folder:
from colorframe import BorderCreator
border_api = BorderCreator(
commandline_pathp="path/to/images/",
left_border=150,
bottom_border=72,
color="blue",
)
border_api.execute_target()
MIT © 2020 Felix Soubelet
Project details
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 colorframe-0.3.0.tar.gz
.
File metadata
- Download URL: colorframe-0.3.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9245b2ccdf86c9b75b185001f2920f4fba4e24a14cfb0ffe7f4466179c16722 |
|
MD5 | 1cdf02486b16f04022f527e2db4d6922 |
|
BLAKE2b-256 | 5834ea0875d7d987bd34b984bc45c6861aac2be34288a4b27bcd43f14a19d745 |
File details
Details for the file colorframe-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: colorframe-0.3.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 145b27eaea98fce6c4b4cb22b29fc02080338b26ec690916525fadf904be060c |
|
MD5 | 310e334a9a1d3f425ebeb3b7d2ec5b96 |
|
BLAKE2b-256 | cade94981886584d30d89a737389e918cbb9454d42caa20d9054e6e0706fb6e5 |