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.2.0.tar.gz (317.1 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.2.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for imgrit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6b0c379b2a133de7644d5a7e867ef0c2150f02a998ce669a578c2cea39c6ed86
MD5 ae68da7a55cee280bcd250dd5bd08579
BLAKE2b-256 05c57f787850e367e2a3b436189f7ac4b665096067333ab8508786ac1a37d11f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: imgrit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d941a8222824df5fa274e81d6901c4b34bdf828d04bbe41061f4c995f302af6d
MD5 a538276edfc89f178f6aef4f6f848a88
BLAKE2b-256 ee6f0b31dbbab8b532a0cb53ac624a41991f7e01ea9af992bd5e65695d85d904

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