Skip to main content

cjm-pil-utils

Install

pip install cjm_pil_utils

How to use

get_img_files

from cjm_pil_utils.core import get_img_files
from pathlib import Path
img_dir = Path('../images/')
img_paths = get_img_files(img_dir)
img_paths
[PosixPath('../images/cat.jpg'), PosixPath('../images/depth-cat.png')]

resize_img

from cjm_pil_utils.core import resize_img
from PIL import Image  # For working with images
img_path = img_paths[0]
src_img = Image.open(img_path).convert('RGB')
print(f"Image Size: {src_img.size}")

resized_img = resize_img(src_img, target_sz=384, divisor=32)
print(f"New Image Size: {resized_img.size}")
Image Size: (768, 512)
New Image Size: (576, 384)

stack_imgs

from cjm_pil_utils.core import stack_imgs
stacked_imgs = stack_imgs([resized_img, resized_img])
print(f"Stacked Image Size: {stacked_imgs.size}")
Stacked Image Size: (576, 768)

avg_images

from cjm_pil_utils.core import avg_images
img_1, img_2 = (Image.open(path) for path in img_paths)
avg_img = avg_images(img_1, img_2, 0.5)

crop_square

from cjm_pil_utils.core import crop_square
crop_square(src_img).size
(512, 512)

Metadata

Release files for cjm-pil-utils 0.0.9

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

Source distribution (sdist)

Source distribution for cjm-pil-utils 0.0.9
File Size Uploaded Provenance
cjm-pil-utils-0.0.9.tar.gz 8.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cjm-pil-utils 0.0.9
File Interpreter ABI Platform
cjm_pil_utils-0.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 16.1 kB

Release files / cjm-pil-utils-0.0.9.tar.gz

Download URL cjm-pil-utils-0.0.9.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
314d75c66aba1efb5061b643ab54086e8bfc35c394cf520ec57667f18cdeec40
BLAKE2b-256 checksum
How to use checksums
73d8e5eeb8eaa0e715c60cbe9157e22746468ae781844ef05a14aaffc5d9eab8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / cjm_pil_utils-0.0.9-py3-none-any.whl

Download URL cjm_pil_utils-0.0.9-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e86b78090d40a4a7e5e95d4451be427c36327b3cd519a139ef4e43bc5773c444
BLAKE2b-256 checksum
How to use checksums
fc0badc3d75b0f81233a8825b0da4536241743ece3ce0ae33d65b5c1a9b0e2a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Security for cjm-pil-utils 0.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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