Class 34 — April 13
Image visualization
The greatest artists — Learned at the feet of masters — Copy and improve
Look both ways
Zoom
To do
- Review artifacts
- Check out imaging epistle
- Homework 30
Agenda
- Image transformations
- Implement image duplication
- Implement image bluing
- Implement image monotone
- Implement image color inversion
- Implement image flipping
- Implement image mirroring
- Implement image sepiaing
Image manipulator
- Module manip.py
Some image manipulation descriptions
- Module copy.py
- Module blue.py
- Module bw.py
- Module neg.py
- Module flip.py
- Module reflect.py
- Module sepia.py
Homework
- Implement grayscaling
- Module gray.py
- Implement clockwise rotation
- Module cw.py
- Implement palette reduction
- Module palette.py
I see you
| | Duplicate |
| | Bluing |
| | Monotone |
| | Mirror |
| | Flip |
| | Sepia |
| | Grayscale |
| | Clockwise rotation |
| | Palette reduction |
| | Zooming |
| | Pixelate |
Basic photo-manipulation problem-solving Python function
def manip( original, size, color, where ) :
''' Provide a pattern for image manipulation
'''
# set dimensions of the new image
nw, nh = size( original )
# get a new appropriately sized image
new_image = Image.new( 'RGB', ( nw, nh ) )
# fill in every pixel of the new image
for nx in range( 0, nw ) : # consider every x value for the new image
for ny in range( 0, nh ) : # in tandem with every y value for the image
# set the spot to be filled in the new image
nspot = ( nx, ny )
# determine the corresponding spot of interest in the original
ospot = where( nspot, original )
# get the pixel at the ospot
opixel = original.getpixel( ospot )
# determine the pixel for the new image
npixel = color( opixel )
# set the nspot in the new image
new_image.putpixel( nspot, npixel )
# return the filled in new image
return new_image
© 2020 Jim Cohoon | Resources from previous semesters are available. |