Skip to main content

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

Project details


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 hashes)

Uploaded Source

Built Distribution

imTriangle-0.0.3-py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page