Skip to main content

Python extension for the CImg library.

Project description

Build Status Coverage Status Documentation Status PyPI version

README

pycimg is a python extension for the CImg library.

The package contains a single class CImg that provides access to the image processing methods of the CImg library.

Pixel data of CImg objects can be accessed as a numpy array.

Vice versa new CImg objects can be created from pixel data in a numpy array or an image file. Supported file formats are png, jpeg, tiff, bmp, and cimg.

from pycimg import CImg
import numpy as np

# Load image from file
img = CImg('test/test.png')
img.display()

# Access pixel data as numpy array
arr = img.asarray()
# Set pixels in upper left 100 x 100 px rectangle
arr[:,:,0:99,0:99] = 0
# Pixel data is shared with the image instance
img.display()

# Create image from numpy array
img = CImg(np.random.randn(100,100))

Features

  • Access pixel data as a numpy array.

  • Builtin support for reading/writing png, jpeg, and tiff image formats.

Installation

Install pycimg by running:

pip install pycimg

Documentation

See readthedocs.

License

The project is licensed under the GPL3 license.

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

pycimg-2.0.0.tar.gz (14.4 kB view hashes)

Uploaded source

Built Distributions

pycimg-2.0.0-cp311-cp311-win_amd64.whl (2.2 MB view hashes)

Uploaded cp311

pycimg-2.0.0-cp310-cp310-win_amd64.whl (2.2 MB view hashes)

Uploaded cp310

pycimg-2.0.0-cp39-cp39-win_amd64.whl (2.2 MB view hashes)

Uploaded cp39

pycimg-2.0.0-cp38-cp38-win_amd64.whl (2.2 MB view hashes)

Uploaded cp38

pycimg-2.0.0-cp37-cp37m-win_amd64.whl (2.2 MB view hashes)

Uploaded cp37

pycimg-2.0.0-cp36-cp36m-win_amd64.whl (2.2 MB view hashes)

Uploaded cp36

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page