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

Uploaded Source

Built Distribution

imPixelate-0.0.2-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file imPixelate-0.0.2.tar.gz.

File metadata

  • Download URL: imPixelate-0.0.2.tar.gz
  • Upload date:
  • Size: 732.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.2

File hashes

Hashes for imPixelate-0.0.2.tar.gz
Algorithm Hash digest
SHA256 bfec338fa42c0068849fa752685c2e44cfa2fb50a8f389f8754f72db4476b749
MD5 9da7b8880641d797e40d0f48ca9f1ed0
BLAKE2b-256 f5dfee1d61eb372dc61eb2cd5b5dd62fe5c723a664144085acec6e1bcb722ade

See more details on using hashes here.

Provenance

File details

Details for the file imPixelate-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: imPixelate-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.2

File hashes

Hashes for imPixelate-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 62749047a2b97bfa80fd0745d8abd27defa571e58b7a8e73e9f81abe4f1990c9
MD5 35419948821a338ca96a7c8740429ee1
BLAKE2b-256 50bbe7e7275c63c01ebfd7021fb77ea99abbb8843a6d3f3e9f7d744d6ae99880

See more details on using hashes here.

Provenance

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