Skip to main content

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

Project description

gmic-py

Python binding for G'MIC

The aim of this project is to provide an official Python 3 package of the G'MIC image processing library, with its platform-specific binaries bundled or auto-compiled. When this matures, running pip install gmic-py should be all you need to get ready and use G'MIC within data-science, games, video editing, texture editing etc.. Python scripts.

This project is a work in progress and lives under the CeCILL license (similar to GNU Public License).

TDD - making sure gmic-py works and keeps working

Development follows a test-driven development (TDD) methodology.

For now, to test the development manually you can run a pytest suite within docker:

# If you do not have docker: sudo apt-get install docker
cd tests/
sh run_test_scenario.sh

On November 18th, 2019 pip install from Github, echo, basic png generation and output tests work, without in-memory buffers I/O yet :) The project is just very fresh :) See Github Actions CI tests being run here.

Roadmap

Q4 2019

  1. Create a pip install -e GITHUB_URL installable Python package for GMIC, with an API very similar to the C++ library: gmic_instance.run(...), gmic(...) and matching exception types. Binary dependencies should be bundled as in this tutorial.
    1. Through Ctypes dynamic binding on an Ubuntu docker image using Python 2-3. DONE in ctypes/
    2. Through custom Python/C++ binding in cpython/
  2. Create documented examples for various application domains.

Q1-Q2 2020

  1. Move the package to official Python package repositories.
  2. In a separate repository, create a Blender Plugin, leveraging the Python library and exposing:
  3. a single Blender GMIC 2D node with a text field or linkable script to add a GMIC expression
  4. as many 2D nodes as there are types of GMIC 'operators'

Q3-Q4 2020

  1. In a separate repository, create a GMIC Inkscape plugin, leveraging the Python library (possibly applying only to image objects, as the Trace bitmap tool does).

Binding blueprint

This is an overview of how we want the gmic binding inner working:

from gmic import Gmic, run, Image, GmicException
#we give up the Gmic native List

class GmicException:
   def __init__(self, command, message):
       self.command = command
       self.message = message
   def what(self):
       pass
   def command_help(self):
       pass

class Gmic:
    def __init__(self, images=[]|tuple|iterable[Image], image_names=[]|tuple|iterable, include_stdlib=True, progress=None, is_abort=None):
        self._status = None
        self.include_stdlib = include_stdlib
        # TODO V2 = progress, is_abort
        if all params were given:
           self.run(images, image_names, include_stdlib, progress, is_abort)

    @throws GmicException
    def run(self, images=[], images_names=[], progress=None, abort=None):
        ....
        self._status = ""
        return self

    def _build_lists(self):
        self._build_gmic_images_list(self.images)
        self._build_gmic_images_names_list(self.image_names)

    def _build_gmic_images_list(self):
        """Convert and store to Gmic builtin C++ type"""
        pass

    def _build_gmic_images_names_list(self):
        """Convert and store to Gmic builtin C++ type"""
        pass

    @property
    def status(self):
       """ string result of last operation, or exception text if was raised, or user-entered text through a gmic command. 
       This is a read-only attribute, starting with underscore. See https://stackoverflow.com/a/15812738/420684
       :return str
       """
       return self._status


def run(images=[]|tuple|iterable[Image], image_names=[]|tuple|iterable[Image], include_stdlib=True, progress=None, is_abort=None):
    return Gmic(images, images_names, include_stdlib, progress, is_abort).run()

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

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

gmic-2.8.0.dev2-cp38-cp38-manylinux1_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.8

gmic-2.8.0.dev2-cp37-cp37m-manylinux1_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.7m

gmic-2.8.0.dev2-cp36-cp36m-manylinux1_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.6m

gmic-2.8.0.dev2-cp35-cp35m-manylinux1_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.5m

gmic-2.8.0.dev2-cp34-cp34m-manylinux1_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.4m

File details

Details for the file gmic-2.8.0.dev2-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: gmic-2.8.0.dev2-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5

File hashes

Hashes for gmic-2.8.0.dev2-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 16850d6d8dfd1432ace1a710c206a71368ed95f76b0d712c32c7f5115a8f5354
MD5 d2331e832a6c22ed2e57f292567970c8
BLAKE2b-256 3aec8cf2f064e32ff0ee98887eaac5363393f41d55165b8f6b9d638a8b81f195

See more details on using hashes here.

File details

Details for the file gmic-2.8.0.dev2-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: gmic-2.8.0.dev2-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5

File hashes

Hashes for gmic-2.8.0.dev2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d34f231308ed9201258f6e49ef4bf194371a0b98cd919a6a3b0a19dc76a3982e
MD5 48455324f5b381f2a406f9ae15123df1
BLAKE2b-256 35c90f1032cae59d8d27513287c24420f67ec22b97f8af25ca06fafb23c6fc41

See more details on using hashes here.

File details

Details for the file gmic-2.8.0.dev2-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: gmic-2.8.0.dev2-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5

File hashes

Hashes for gmic-2.8.0.dev2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ff2d1f5df5d1e2378858d984d57d0df13e1ba25d053aae723c97b33b24290969
MD5 ec009613acf850a11f1c87b53824a28a
BLAKE2b-256 97fd4b387afccea70437b257f2b504909e2b9c6dc74246cd5cc2f0de66a47d89

See more details on using hashes here.

File details

Details for the file gmic-2.8.0.dev2-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: gmic-2.8.0.dev2-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5

File hashes

Hashes for gmic-2.8.0.dev2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c25c3f7fa47755ea64972c84598baba66fd2dca2eec11ddc9038d9c35509ae8b
MD5 9c137f7f7b53ade492c0338d95c76b18
BLAKE2b-256 2559cccd19909f0b5e298529778a99ce4e4d1d16c877102c3516e02e60c8699c

See more details on using hashes here.

File details

Details for the file gmic-2.8.0.dev2-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

  • Download URL: gmic-2.8.0.dev2-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.4m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5

File hashes

Hashes for gmic-2.8.0.dev2-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e0b241ce3bcf9fde69a6c48c3efd797d0b64621935cafb9186a79795fc7200cc
MD5 d24baf3a3987475eb6f90ca315d08ef3
BLAKE2b-256 95d5065794ccb4dfcff7096cc2a5377386b2fa194fe3080f42685f63befa82a1

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