Skip to main content

A tiny image processing library with k-means and Voronoi diagram.

Project description

README

This is a tiny image processing library to conver your images to Voronoi mosaic or Warhol effect images. We used k-means clustering algorithms to determine the position of Voronoi sites and pixel groups of Warhol effect.

How to use

pip install imgrit

The library depends on Pillow, NumPy, and SciPy.

If you have scikit-learn, the library uses the faster k-means.

The following is the input image.

from PIL import Image
import imgrit

my_image = Image.open("../images/original.jpg")
voronoi_mosaic = imgrit.voronoi_mosaic(my_image, 250)
voronoi_mosaic.save("voronoi-mosaic.png")
warhol_effect = imgrit.warhol_effect(my_image, 10)
warhol_effect.save("warhol-effect.png")

OpenSea

If you'd like to see more images, please visit Asakura Gallery Digital at OpenSea.

Citations

under preparetion.

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

imgrit-0.1.3.tar.gz (175.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imgrit-0.1.3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file imgrit-0.1.3.tar.gz.

File metadata

  • Download URL: imgrit-0.1.3.tar.gz
  • Upload date:
  • Size: 175.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for imgrit-0.1.3.tar.gz
Algorithm Hash digest
SHA256 991f7658d4c83a999b430c823139f82283473957c0693fe8922797d60e0592f5
MD5 6b5730a0a4e2578dcbe39babf74079a7
BLAKE2b-256 ccc44a27b0d4bca562df40dac584b026d2e59b879fa223c9e676a03938b03140

See more details on using hashes here.

File details

Details for the file imgrit-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: imgrit-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for imgrit-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 41de3f8cd44ab9cadce69e05afaa8a0ae9532a5a332c51ce00d30890dc89e7cf
MD5 922adfc1678e673b6543e6b8827c2dff
BLAKE2b-256 13ae0bfcc16a43808e9560340aaa7c5cfab29cead4ac3492c0b95956c21dba79

See more details on using hashes here.

Supported by

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