Skip to main content

Image manipulation library for media computation education

Project description

cImage - A simple image processing library for Python

Installation

copy cImage.py to your site-packages directory.

Usage

This image library is not going to give you fancy high performance operations on images. It allows you to read in an image and manipulate its pixels. Then you can save the new image to a file, or you can display the image in a window. Thats really about it, but its really all you want to do if you are teaching an introductory computer science course.

Image Types Supported

If you have PIL installed on your system:

  • jpeg

  • gif

  • tiff

  • png

  • etc.

If you do not have PIL installed then you are stuck with GIF images only.

If you are using Python 2.6/2.7 I recommend you install Pillow its a simple fork of PIL that you can install with easy_install or pip.

If you are using Python 3 You can get a working version of PIL Here: https://pypi.python.org/pypi/Pillow/2.0.0

Note that if you scroll down to the bottom you will find binary installations for Windows. Linux and Mac users can follow the instructions on the page.

Example

from cImage import *
myimagewindow = ImageWin("Image Processing",600,300)
oldimage = FileImage("lutherbell.jpg")
oldimage.setPosition(0,0)
oldimage.draw(myimagewindow)

width = oldimage.getWidth()
height = oldimage.getHeight()
newim = EmptyImage(width,height)

for row in range(height):
    for col in range(width):
            oldpixel = oldimage.getPixel(col,row)
            ave=(oldpixel.getRed()+oldpixel.getGreen()+oldpixel.getBlue())/3
            newim.setPixel(col,row,Pixel(ave,ave,ave))

newim.setPosition(width+1,0)
newim.draw(myimagewindow)

myimagewindow.exitOnClick()

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

thonny-cImage-1.4.2.tar.gz (7.1 kB view details)

Uploaded Source

Built Distributions

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

thonny_cImage-1.4.2-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

thonny_cImage-1.4.2-py2.py3-none-any.whl (9.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file thonny-cImage-1.4.2.tar.gz.

File metadata

  • Download URL: thonny-cImage-1.4.2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for thonny-cImage-1.4.2.tar.gz
Algorithm Hash digest
SHA256 1997027471d7561f0cae47d151471f4a0afd2377dd4c4b0329417723cbf3cd5c
MD5 95b5486f2d3f6d36edcf93f25e57151c
BLAKE2b-256 38ddb70efe6b91e3e62d7b372e0bdbbe16c79c044c3e75e6a1eefebafdbf8fab

See more details on using hashes here.

File details

Details for the file thonny_cImage-1.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for thonny_cImage-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a2120c3766b2bb90e5cd4c5bb536cc891d1da7bc653c39cbe08a1544e78b9919
MD5 a8b9e6aa7443936033d318eddce5f75e
BLAKE2b-256 fd2090598ff88fc984a074b4bf4e39b3a9c7d6e5d946680eb26796e6206d5fe6

See more details on using hashes here.

File details

Details for the file thonny_cImage-1.4.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for thonny_cImage-1.4.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5ae10942e8bcb82d0dfc9842ac2a7da66c900ba7aecd9ee438ef3ea068e0a07b
MD5 ef9cad21b97333472ec68ab313fbaa1e
BLAKE2b-256 16905a1697e66f970d4f58fd0f50ba9b79a4636a0f8c34c5d05a419472f9afb9

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