Binary Python3 bindings for the G'MIC C++ image processing library
Project description
Python binding for G'MIC - A Full-Featured Open-Source Framework for Image Processing
https://gmic.eu
gmic-py
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-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
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()
Creating a flipbook from a GIF file
Filtering GIF images, ontage'd into an A4 sheet paper.
Jupyter / Google Colab / IPython integration
gmic-py
provides G'MIC console output retrieval and images display
emulation for IPython/Jupyter/Google Colab environments:
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for gmic-2.9.4a1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afebf047a2b21aa7d63e7969d30810a6d68151485b5d7500c1b35053254ad00a |
|
MD5 | 03f79f3d6dc0a54b5288d04e9bf1e92e |
|
BLAKE2b-256 | 22101185f878bd29e5f228713aa95954222406f23811d959209ddb154c98e4ba |
Hashes for gmic-2.9.4a1-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68a93911b03bbaca4a9cabe83d3c5746e868176f08a1f38d5bedbcdda50b021c |
|
MD5 | 4a1238a88740d0940dc3c5ef6015dd7a |
|
BLAKE2b-256 | 75cdb2f34dcda8e1ddea345e071d6b6165aa3319e53f00a422ae4c7fd9b9d22b |
Hashes for gmic-2.9.4a1-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a64633e70a80419b7413b31c84a7ba612cfbfcd8c4160cadb10de28eebecad5 |
|
MD5 | 1bb8db8a7a18a17e0c0007c5c24bc65e |
|
BLAKE2b-256 | 9f41ce209e9d0eb365c11621ae5715d85459e31ec996d5ae259fe53c48bf2168 |
Hashes for gmic-2.9.4a1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c02372eeaec2eee1de1ad666331d88bfdd10af36df5dd3edf1aaeb70d92698db |
|
MD5 | 7e6ede70626986ac0df987462af6fff2 |
|
BLAKE2b-256 | 51785d64353aa7276a453a57e9505551771547541590ae86db218aca341780a7 |
Hashes for gmic-2.9.4a1-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a87ca90eae073ce1ede06985d5e52bcce50b542b7d9d4ec619f3a398b57e2581 |
|
MD5 | 1e287eb48a53b6790eadd7aa192804c7 |
|
BLAKE2b-256 | 0f9284f950bf0fa28cf52156b11a784f0017941f3dd8be858e4525cf6eacc10a |
Hashes for gmic-2.9.4a1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a93bc43deaccabc336215a26ba18c0bf69b8376f34495a64a2d53c46eb62fb0e |
|
MD5 | 99b9ccdcdf144869991d49369fbd90cd |
|
BLAKE2b-256 | f66e8dbfdf4b218796afef768f796b33c4fd060d83c7658a4f5794923ab48d3d |
Hashes for gmic-2.9.4a1-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dbcadd95f44580ab7aecbd021e3e83c435eca6545758779a117c9765735ea30 |
|
MD5 | b85226eb59f42e05dd65b0587767c1de |
|
BLAKE2b-256 | 3467eaf3b2e5205c843d61149d6ddb877a60710fb2d911da671dc5e144fa0e05 |
Hashes for gmic-2.9.4a1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2efc09a07bbf5e2e9eabfe89f72b04c6239377a2e1f309736c7127a3539abf2 |
|
MD5 | e523b1a9289b24014c52fb1b9edd538b |
|
BLAKE2b-256 | a365654830a390e26a6c8273d05322ca762a68cdac43216beb43073d55dace94 |