Skip to content

Mamdasn/imPixelate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPI Latest Release Package Status Downloads License Repository Size

ImPixelate

This snippet of code attempts to pixelate images.

Installation

Run the following to install:

pip install imPixelate

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

About

This snippet of code attempts to pixelate images.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages