Skip to main content

This snippet of code attempts to pixelate images.

Project description

ImPixelate

This snippet of code attempts to pixelate images.

Usage

import cv2, os
import numpy as np
from imPixelate import pix

img_fullname = "assets/lotus.jpg"
img_name, img_ext = os.path.splitext(img_fullname)

img = cv2.imread(img_fullname)
img_out = img.copy()

[h, w, d] = img.shape
for i in range(d):
    img_out[:, :, i] = pix(img[:, :, i].copy())
cv2.imwrite(f'{img_name}-pixelate{img_ext}', img_out)

Output

This is a sample image:
lotus.jpg
This is the sample image pixelated:
lotus-pixelate.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

imPixelate-0.0.2.tar.gz (732.8 kB view hashes)

Uploaded Source

Built Distribution

imPixelate-0.0.2-py3-none-any.whl (2.8 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