Skip to main content

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()

Made with ♥︎ by fsoubelet
MIT © 2020 Felix Soubelet

Metadata

Release files for colorframe 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for colorframe 0.3.0
File Size Uploaded
colorframe-0.3.0.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for colorframe 0.3.0
File Interpreter ABI Platform
colorframe-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.8 kB

Release files / colorframe-0.3.0.tar.gz

Download URL colorframe-0.3.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f9245b2ccdf86c9b75b185001f2920f4fba4e24a14cfb0ffe7f4466179c16722
BLAKE2b-256 checksum
How to use checksums
5834ea0875d7d987bd34b984bc45c6861aac2be34288a4b27bcd43f14a19d745
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / colorframe-0.3.0-py3-none-any.whl

Download URL colorframe-0.3.0-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
145b27eaea98fce6c4b4cb22b29fc02080338b26ec690916525fadf904be060c
BLAKE2b-256 checksum
How to use checksums
cade94981886584d30d89a737389e918cbb9454d42caa20d9054e6e0706fb6e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page