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.2.tar.gz (14.6 kB view hashes)

Uploaded source

Built Distributions

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

Uploaded cp311

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

Uploaded cp310

pycimg-2.0.2-cp39-cp39-win_amd64.whl (2.3 MB view hashes)

Uploaded cp39

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

Uploaded cp38

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

Uploaded cp37

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

Uploaded cp36

Supported by

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