Package: gmic
Python binding for G'MIC - A Full-Featured Open-Source Framework for Image Processinghttps://gmic.eugmic-pygmic-pyis the official Python 3 binding for theG'MIC C++ image processing librarypurely written with Python's C API.
Its Python package name onpypi.orgis justgmic.
This project lives under the CeCILL license (similar to GNU Public License).You can use thegmicPython module for projects related to desktop or server-side graphics software, numpy, video-games, image procesing.Check out thegmic-pydocumentation website (readthedocs)for Quickstart, Tutorials, API Reference andgmic-pythird-party integrations.gmic-py's slowly growing community gravitates around:thisGithub's project Issue tracker,Twitter (#gmicpy)the pixls.usgmic-pyforum thread.gmic-blenderis a Blender3d add-on bundlinggmic-pyand allowing you use a newgmicmodule from there without installing anything more.QuickstartFirst install the G'MIC Python module in your (virtual) environment.pipinstallgmicG'MIC is a language processing framework, interpreter and image-processing scripting language.
Here is how to loadgmic, and evaluate some G'MIC commands with an interpreter.importgmicgmic.run("sp earth blur 4")# On Linux a window shall open-up with a blurred earthgmic.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 fileAfull-featuredgmic-pyQuickstart tutorialis available here.
Tutorials on various topics are available in thedocumentation.DocumentationFull documentation is being written athttps://gmic-py.readthedocs.io/.Supported platformsgmic-pyworks 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 thepipinstaller will downloadgmic-py's source and most possibly compile it very well.
See theCONTRIBUTING.mdfile and thedocumentationfor tips on buildinggmic-pyfor your own OS.ExamplesAll examples belongin the examples/ folder.Some of them correspond totutorials ongmic-py's readthedocs website.Applying a simple filterimportgmicgmic.run("sample apples rodilius 10 display")# more at https://gmic.eu/reference/rodilius.htmlExample from tutorial 1Numpy integrationgmic-pysupportsGmicImageinput/output withnumpy,scikit-imageandPillow(PIL) if any of those are installed.Example from the Quickstart tutorialimportnumpyfrommatplotlibimportpyplotaspltimportgmicimages=[]gmic.run("sp apples blur_x 30 fx_freaky_bw 90,20,0,0,0,0",images)# horizontal blur+special black&whitenumpy_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 fileFiltering GIF images, ontage'd into an A4 sheet paper.Example from tutorial 3Jupyter / Google Colab / IPython integrationgmic-pyprovides G'MIC console output retrieval and imagesdisplayemulation for IPython/Jupyter/Google Colab environments:Details on therelated Jupyter/IPython/* support documentation page.Using your camera with G'MIC's optional OpenCV linking (advanced)If your machine haslibopencvinstalled and youbuildgmic-pyfrom source(ie.python setup.py build), G'MIC OpenCV commands will be enabled.Example G'MIC OpenCV script