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:
Metadata
Release files for imTriangle 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| imTriangle-0.0.3.tar.gz | 761.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| imTriangle-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 764.4 kB
Release files / imTriangle-0.0.3.tar.gz
| Download URL | imTriangle-0.0.3.tar.gz |
|---|---|
| Size | 761.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
adb174a573da776a407cfd946ee443416958fb0af61b2e5728439dbf52e3ed5d
|
|
BLAKE2b-256 checksum How to use checksums |
be0484d56a66f708755d7cb813c18cceb917c7942253fdfffed8075036f6f087
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / imTriangle-0.0.3-py3-none-any.whl
| Download URL | imTriangle-0.0.3-py3-none-any.whl |
|---|---|
| Size | 2.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d4c457331d83a60a80692e7f7f15c1ffc447a35cf7b9f9b0bcc44c74a219180b
|
|
BLAKE2b-256 checksum How to use checksums |
e0bb262cee4fe7231cf660b91f1732c75824e4283aeaaf735afac46322f2a02f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|