Skip to main content

Binary Python3 bindings for the G'MIC C++ image processing library

Project description

G'MIC Logo Python Logo

Python binding for G'MIC - A Full-Featured Open-Source Framework for Image Processing

https://gmic.eu

gmic-py

PyPI version shields.io PyPI download monthly PyPI license PyPI format PyPI pyversions PyPI implementation PyPI status Read the Docs

CPython GMIC Optimized Python package (Source and Debian/Ubuntu OS compilation) CPython GMIC Manylinux 2010 & 2014 x86_64 Optimized No-release CPython GMIC Debug Python package (Source and Debian/Ubuntu OS compilation) CPython GMIC MacOS Optimized Build

gmic-py is the official Python 3 binding for the G'MIC C++ image processing library purely written with Python's C API. Its Python package name on pypi.org is just gmic. This project lives under the CeCILL license (similar to GNU Public License).

You can use the gmic Python module for projects related to desktop or server-side graphics software, numpy, video-games, image procesing.

Check out the gmic-py documentation website (readthedocs) for Quickstart, Tutorials, API Reference and gmic-py third-party integrations.

gmic-py's slowly growing community gravitates around:

gmic-py 2.9.2 release plan

gmic-blender is a Blender3d add-on bundling gmic-py and allowing you use a new gmic module from there without installing anything more.

Quickstart

First install the G'MIC Python module in your (virtual) environment.

pip install gmic

G'MIC is a language processing framework, interpreter and image-processing scripting language. Here is how to load gmic, and evaluate some G'MIC commands with an interpreter.

import gmic
gmic.run("sp earth blur 4") # On Linux a window shall open-up with a blurred earth
gmic.run("sp rose fx_bokeh 3,8,0,30,8,4,0.3,0.2,210,210,80,160,0.7,30,20,20,1,2,170,130,20,110,0.15,0 output rose_with_bokeh.png") # Save a rose with bokeh effect to file

A full-featured gmic-py Quickstart tutorial is available here. Tutorials on various topics are available in the documentation.

Documentation

Full documentation is being written at https://gmic-py.readthedocs.io/.

Supported platforms

gmic-py works for Linux and Mac OS x 64bits architecture x Python >= 3.6. Windows support is planned for Q4 2020.

In case your environment is a type of Unix, but compiling from source is needed, note that the pip installer will download gmic-py's source and most possibly compile it very well. See the CONTRIBUTING.md file and the documentation for tips on building gmic-py for your own OS.

Examples

All examples belong in the examples/ folder.

Some of them correspond to tutorials on gmic-py's readthedocs website.

Applying a simple filter

import gmic
gmic.run("sample apples rodilius 10 display") # more at https://gmic.eu/reference/rodilius.html

Example from tutorial 1

Apple with rodilius effect

Numpy integration

gmic-py supports GmicImage input/output with numpy, scikit-image and Pillow (PIL) if any of those are installed.

Example from the Quickstart tutorial

import numpy
from matplotlib import pyplot as plt
import gmic

images = []
gmic.run("sp apples blur_x 30 fx_freaky_bw 90,20,0,0,0,0", images) # horizontal blur+special black&white
numpy_im = images[0].to_numpy_helper(interleave=True,permute="yxzc", squeeze_shape=True, astype=numpy.uint8)
plt.imshow(numpy_im, plt.get_cmap('gray'))
plt.show()

Numpy + Matplotlib

Creating a flipbook from a GIF file

Filtering GIF images, ontage'd into an A4 sheet paper.

Example from tutorial 3

Example flipping

Jupyter / Google Colab / IPython integration

gmic-py provides G'MIC console output retrieval and images display emulation for IPython/Jupyter/Google Colab environments:

Jupyter support example

Details on the related Jupyter/IPython/* support documentation page.

Using your camera with G'MIC's optional OpenCV linking (advanced)

If your machine has libopencv installed and you build gmic-py from source (ie. python setup.py build), G'MIC OpenCV commands will be enabled.

Example G'MIC OpenCV script

Live example

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

gmic-2.9.2-cp39-cp39-manylinux2014_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.9

gmic-2.9.2-cp39-cp39-manylinux2010_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

gmic-2.9.2-cp38-cp38-manylinux2014_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.8

gmic-2.9.2-cp38-cp38-manylinux2010_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

gmic-2.9.2-cp37-cp37m-manylinux2014_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.7m

gmic-2.9.2-cp37-cp37m-manylinux2010_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

gmic-2.9.2-cp36-cp36m-manylinux2014_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.6m

gmic-2.9.2-cp36-cp36m-manylinux2010_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

File details

Details for the file gmic-2.9.2-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

  • Download URL: gmic-2.9.2-cp39-cp39-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 5.3 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.12

File hashes

Hashes for gmic-2.9.2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0c85f6767c2c78300223abf188e2756ee23b4f74b8fca3f5eb08721119e7697f
MD5 6f3672009ae266ddc3905ed8a5b572ac
BLAKE2b-256 2728e5e6997e578a08c17d5f8150cf8e1297212192af50010ea183a3ed822fed

See more details on using hashes here.

File details

Details for the file gmic-2.9.2-cp39-cp39-manylinux2010_x86_64.whl.

File metadata

  • Download URL: gmic-2.9.2-cp39-cp39-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.12

File hashes

Hashes for gmic-2.9.2-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 b4ed5842cb871401f108ba9519628b2a96e64702243ad0134ad74f850bd35c90
MD5 625099aa7f2065b3f20f4fbe40f7feff
BLAKE2b-256 e531c3c1aa28d2d79bb92592f3911af5a7235368f806116f8eb7dbfb209c9704

See more details on using hashes here.

File details

Details for the file gmic-2.9.2-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: gmic-2.9.2-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 5.4 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.12

File hashes

Hashes for gmic-2.9.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0bbeb0eaa7af1a51a59c518fc96f5692df3b0e2b122c2533d51e31e20b826979
MD5 855e83e7f07cebdb6ef357e1d32af1af
BLAKE2b-256 8b42aeb3dfef01aee2b7542f6b499d50f2d2cfbb915559fffa71eaa1b7b2fb0c

See more details on using hashes here.

File details

Details for the file gmic-2.9.2-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: gmic-2.9.2-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.12

File hashes

Hashes for gmic-2.9.2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 44124fc79cdb0838ea465ce2ecec38a4bac1f4335e1b89ce52045c674b9ae6d0
MD5 ce843fcf139eafb98df721627ec62a2a
BLAKE2b-256 aab2f1dee48fc48dc09b2a57f1dd7d27e0843d8ccee078ae944c24c9c9081326

See more details on using hashes here.

File details

Details for the file gmic-2.9.2-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: gmic-2.9.2-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 5.4 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.12

File hashes

Hashes for gmic-2.9.2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f2946dcd5922ea875f7a54cd1340b2c9f5da3de89e9517fb72c9931c842431d3
MD5 2ba39dfb1495e04314360b8610938fa4
BLAKE2b-256 5bc93a6f68222be9100b1dfa16e3c52609e27155673ddfcdb48f7e501a37ce5a

See more details on using hashes here.

File details

Details for the file gmic-2.9.2-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: gmic-2.9.2-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.12

File hashes

Hashes for gmic-2.9.2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 9e88c9683bccc84ad4a06de36ddc51aeb271c3a4e31205d696762e7453b19af1
MD5 6642569380982bcab74df2023bf3c6e3
BLAKE2b-256 283c33734b2e0b2b238fc043eaf82f6e7eb15e0a7bfe3b40de1a9ec455376511

See more details on using hashes here.

File details

Details for the file gmic-2.9.2-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: gmic-2.9.2-cp36-cp36m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 5.4 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.12

File hashes

Hashes for gmic-2.9.2-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2c5ffe8d081b36a1892788a8cb8e6fb2698072282ac1b91fbbd69fa4a8f1e5db
MD5 dc1bf8cad82e3b81260addb37f17ed35
BLAKE2b-256 f7f9e62b991a74679642c7d206d25da0cfc8afe4603ecd8a1dad4588008514c8

See more details on using hashes here.

File details

Details for the file gmic-2.9.2-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: gmic-2.9.2-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.12

File hashes

Hashes for gmic-2.9.2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 4703dff0d81734ef86ddb394dcca964985fbe233cc2c7fc2f2323a6d05b92366
MD5 fe40da52dda78b8c8f768ba82799f261
BLAKE2b-256 197242db093795589aa16f7f2bc374c3533f1922a88d4cc935765abe6d9f858d

See more details on using hashes here.

Supported by

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