This snippet of code attempts to put triangle pixelation effect on images.
Project description
imTriangle
This snippet of code attempts to put triangle pixelation effect on images.
Installation
Run the following to install:
pip install imTriangle
Usage
import cv2
import numpy as np
from imTriangle import triangle
img_fullname = 'assets/lotus.jpg'
img = cv2.imread(img_fullname)
img_out = img.copy()
[h, w, d] = img.shape
for i in range(d):
img_out[:, :, i] = triangle(img[:, :, i].copy())
cv2.imwrite('assets/lotus-triangled.jpg', img_out)
Or
imTriangle --input 'assets/lotus.jpg' --output 'assets/lotus-triangled.jpg'
Output
This is a sample image:
The sample image after tirangle pixelation effect:
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
imTriangle-0.0.3.tar.gz
(761.5 kB
view details)
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 imTriangle-0.0.3.tar.gz.
File metadata
- Download URL: imTriangle-0.0.3.tar.gz
- Upload date:
- Size: 761.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adb174a573da776a407cfd946ee443416958fb0af61b2e5728439dbf52e3ed5d
|
|
| MD5 |
78eccfca1a461e36ef027ac3f1940773
|
|
| BLAKE2b-256 |
be0484d56a66f708755d7cb813c18cceb917c7942253fdfffed8075036f6f087
|
File details
Details for the file imTriangle-0.0.3-py3-none-any.whl.
File metadata
- Download URL: imTriangle-0.0.3-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4c457331d83a60a80692e7f7f15c1ffc447a35cf7b9f9b0bcc44c74a219180b
|
|
| MD5 |
72e2f512ab553651ccc29890135e96e0
|
|
| BLAKE2b-256 |
e0bb262cee4fe7231cf660b91f1732c75824e4283aeaaf735afac46322f2a02f
|