Class 38 — Monday November 25
Image manipulation
I need a haiku — I can't think of one I like — Will you please help me
Importance of following directions
Look both ways
Tasks
- Redownload manip.py
- Add two functions each to your modules
dimensions.py
andlocate.py
- Define a function
blur()
in module effect.py
- To test your functions use progam photo_ops.py
Module dimensions.py
- Functions to be added
shrink( original )
- Returns the dimensions of an image whose width and height are one half that of image
original
enlarge( original )
- Returns the dimensions of an image whose width and height are twice that of image
original
Module locate.py
- Functions to be added
shrink( spot, w, h )
- Returns a new correspondent location
( a, b )
forspot
, where the dimensions in the correspondent image are twice that ofw
andh
enlarge( spot, w, h )
- Returns a new correspondent location
( a, b )
forspot
, where the dimensions in the correspondent image are half that ofw
andh
Module effect.py
- Function to be added
blur( original )
- Returns a new image that is a 16 by 16 scaling of a 1/16 by 1/16 scaling of
original
- You should find module manip.py functions
zoom_in()
andzoom_out()
helpful.
© 2019 Jim Cohoon | Resources from previous semesters are available. |