Simple Image processing library, used for teaching people how to program
Project description
BYU Simple Image Library
This is a simple library for interacting with images. It is used for instruction in an introductory programming class, CS 110 Introduction to Programming, and CS 111 Introduction to Computer Science at Brigham Young University.
The interface for this library is based off a similar library developed at Stanford University, but was developed independently.
Importing the Library
from byuimage import Image
Creating an image
image = Image(filename)
- creates a new image from a filename
image = Image.blank(width, height)
- creates a new, blank, white image with the given width and height
Image properties
image.height
- returns image height in pixels
image.width
- returns image width in pixels
Iterating over pixels in an image
for pixel in image:
- loops over all pixels, from left to right and top to bottom
for y in range(image.height):
for x in range(image.width):
- loops over all pixels, from left to right and top to bottom
Getting and setting pixels
pixel = image.get_pixel(x,y)
- gets the pixel at the given (x,y) coordinate
pixel.red = value
pixel.green = value
pixel.blue = value
- Sets the pixel red, green, or blue value to the given value
pixel.color = (10, 10, 10)
pixel.color = otherpixel.color
- Sets the pixel red, green, and blue values to the given tuple or pixel color
Showing and saving images
image.show()
- shows an image
image.save(filename)
- saves an image
Credits
The sample image used here is a photo from Mike Newbry, using the Unsplash License, and is available for free at https://unsplash.com/photos/BTE-k0V19Gw
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file byuimage-0.5.0.tar.gz.
File metadata
- Download URL: byuimage-0.5.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a304ecc964ff785882a4d88060b44d8818dc8e72aeff8be4dc06cb591f7f7ed
|
|
| MD5 |
3404a77f3b5923d95eda79830cc6c75f
|
|
| BLAKE2b-256 |
570dbe620de5a07e33f6fdf626ddc442c184d45a538ebef47f67e568204bd933
|
Provenance
The following attestation bundles were made for byuimage-0.5.0.tar.gz:
Publisher:
publish.yml on byu-cs111/simpleimage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
byuimage-0.5.0.tar.gz -
Subject digest:
7a304ecc964ff785882a4d88060b44d8818dc8e72aeff8be4dc06cb591f7f7ed - Sigstore transparency entry: 649547504
- Sigstore integration time:
-
Permalink:
byu-cs111/simpleimage@5c8a179b2527880aa34b1a77d7d0d6795c7e5cd6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/byu-cs111
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5c8a179b2527880aa34b1a77d7d0d6795c7e5cd6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file byuimage-0.5.0-py3-none-any.whl.
File metadata
- Download URL: byuimage-0.5.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ac9c20d693a6c530bfe3da4d84afff816c88f154ba7d68ded0ba3dd7cb13f5a
|
|
| MD5 |
9e54b32e5c88524b9c4760e53b2c3547
|
|
| BLAKE2b-256 |
129a69eff4a4a40571f33f90436324222acc212d6dc965a978418d0873503b55
|
Provenance
The following attestation bundles were made for byuimage-0.5.0-py3-none-any.whl:
Publisher:
publish.yml on byu-cs111/simpleimage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
byuimage-0.5.0-py3-none-any.whl -
Subject digest:
3ac9c20d693a6c530bfe3da4d84afff816c88f154ba7d68ded0ba3dd7cb13f5a - Sigstore transparency entry: 649547565
- Sigstore integration time:
-
Permalink:
byu-cs111/simpleimage@5c8a179b2527880aa34b1a77d7d0d6795c7e5cd6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/byu-cs111
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5c8a179b2527880aa34b1a77d7d0d6795c7e5cd6 -
Trigger Event:
workflow_dispatch
-
Statement type: