Skip to main content

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:
lotus.jpg
The sample image after tirangle pixelation effect:
lotus-triangled.jpg

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)

Source distribution for imTriangle 0.0.3
File Size Uploaded
imTriangle-0.0.3.tar.gz 761.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for imTriangle 0.0.3
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

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