A package for manipulating images using Objective-C frameworks
Project description
macimg
A Python package for manipulating images using Objective-C frameworks.
Examples
Example 1: Applying Image Filters
from macimg import Image
from macimg.filters import (
Bloom,
Comic,
Crystallize,
Edges,
Invert,
Sepia,
Vignette
)
# Load an image
img = Image("assets/Iceland1.jpg")
img.show_in_preview()
# Apply a single filter
Vignette(intensity=10).apply_to(img)
img.show_in_preview()
# Apply multiple filters
filters = [Comic(), Edges(), Invert(), Sepia(), Bloom(), Crystallize(crystal_size=50)]
for index, filter in enumerate(filters):
filter.apply_to(img)
img.show_in_preview()
The code above produces the following sequence of images:
Example 2: Applying Distortions
from macimg import Image
from macimg.distortions import (
Bump,
CircleSplash,
Hole,
LightTunnel,
Pinch,
TorusLens,
Vortex,
)
# Load image
img = Image("assets/Iceland2.jpg")
img.show_in_preview()
# Apply multiple distortions
distortions = [Bump(radius=500, curvature=1), Vortex(radius=750, angle=1000.0), TorusLens(radius=1000, width=250), Hole(), Pinch(intensity=1), CircleSplash(), LightTunnel()]
for index, distortion in enumerate(distortions):
distortion.apply_to(img)
img.show_in_preview()
The code above produces the following sequence of images:
Example 3: Applying Transformations
from macimg import Image
from macimg.transforms import (
Flip,
Rotate,
)
# Load image
img = Image("assets/Iceland3.jpg")
img.show_in_preview()
# Apply multiple transformations
transforms = [Flip("horizontal"), Flip("vertical"), Rotate(degrees=30)]
for index, transform in enumerate(transforms):
transform.apply_to(img)
img.show_in_preview()
The code above produces the following sequence of images:
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file macimg-0.0.3.tar.gz.
File metadata
- Download URL: macimg-0.0.3.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd1ad39cecf96ed0b0232d267e71bc1ba7b5779864ac49227e8ee5c658a1820e
|
|
| MD5 |
220c79294c68d985fdb55ee8b1d1eb44
|
|
| BLAKE2b-256 |
dc3da262b1ed7a76b37c2db3d5f37c2e9f6a1e2cac1f162b07c515603a5145e9
|
File details
Details for the file macimg-0.0.3-py3-none-any.whl.
File metadata
- Download URL: macimg-0.0.3-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de1299c4ea7c2f7eee042f05f7c5680f067e8e1a6cb6783d3cf5c96cac8917e4
|
|
| MD5 |
708206494e5468d9e1746858a3563e96
|
|
| BLAKE2b-256 |
976238fa474da72623ca3b3e10aa09a86b347b22a4e5cbd23dc0d012fbcd5583
|