Skip to main content

Add a border to any image.

Project description

py-image-border

py-image-border is a simple project that lets you easily add borders to screenshots:

$ add-border my_screenshot.png

Installation sets up an add-border shortcut, so you don't need to use any python commands to use the project. If you want, you can also use the following syntax:

$ python -m py_image_border.add_border my_screenshot.png

Installation

Install the package with pip:

$ python -m pip install py-image-border

The only dependency is Pillow.

Usage

You can adjust the size of the border, add some padding between the image and border, and set a custom color for the border:

# 15-pixel border:
$ add-border my_screenshot.png 15

# 10-pixel padding:
$ add-border my_screenshot.png --padding 10

# black border:
$ add-border my_screenshot.png --border-color black

To see the full usage documentation, use --help:

usage: add-border [-h] [--padding PADDING] [--border-color BORDER_COLOR] path [border_width]

Add a border to any image.

positional arguments:
  path                  Path to the original image.
  border_width          Border width (default: 2).

options:
  -h, --help            show this help message and exit
  --padding PADDING     Padding (default: 0).
  --border-color BORDER_COLOR
                        Border color (default: lightgray).

Notes

This project was motivated by the lack of an easy, consistent way to add borders to screenshots on macOS.

The test image is a bear I caught with a game camera, scratching its back against a tree:

Bear scratching its back against a tree

I had left the game camera out much longer than expected, and had about 100k images to go through. I wrote a Python script to flag any image with an area of dark pixels. This was one of about 12 images flagged. :)

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

py-image-border-2023.4.14.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_image_border-2023.4.14-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file py-image-border-2023.4.14.tar.gz.

File metadata

  • Download URL: py-image-border-2023.4.14.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for py-image-border-2023.4.14.tar.gz
Algorithm Hash digest
SHA256 b20d6e45e748a1aec0b4cffac747c095d6ec749d25e3f26c917380c55f390259
MD5 36cadbe3acac1b2a1b22ff133a3b6d6e
BLAKE2b-256 c0bb9319b1974c2d4da3af676c4a1d5582b0006576f3acbb146c74a0fd682626

See more details on using hashes here.

File details

Details for the file py_image_border-2023.4.14-py3-none-any.whl.

File metadata

File hashes

Hashes for py_image_border-2023.4.14-py3-none-any.whl
Algorithm Hash digest
SHA256 0fb8a6a1dbf958563b39e322f9bd6170a251dca56b145c767146cd241631b93a
MD5 77a03b4530a7d58945447be7cf1e9314
BLAKE2b-256 65036a6d36304cdcd6b7e985acbd03ed9eccc9dceb8fd92d4eb2792d4efd4bda

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page