Feeling pretty
In class we discussed modules and objects and did some examples using my simple glib
module. For this lab, you are going to download glib.py
and make a cool-looking collage of images.
For this lab, you'll end up with the following files in the same directory:
glib
Bring your complete project to lab on Friday to show off. To submit it, you'll put the files in a compressed (zip) archive and attach it to the blackboard submission.
Before you can use glib
, you'll need to install the PIL
image processing library in your copy of Python. Run the following command at a sytem command prompt (not in Python!). On windows, you click the start menu and type cmd
to bring up a black-box command prompt. On Mac or Linux, use a terminal.
py -3 -m pip install Pillow
Test your install by opening up Python and typing import PIL
at the interactive top level. If it doesn't error, you're all good.
The glib
module has documentation strings included with its functions. I used pydoc to automatically generate the documentation here. Use this as a reference to know what you can do with glib
.
Remeber! The first thing you need to do in your code file is import glib
, either the whole thing, or the functions you want to use.
You can also check the example from class today if you need a kickstart, but I encourage you to try starting from scratch on your own first.
Make a collage of images! Guidelines and example below.
An example collage:
We talked at the end of class about how glib
is just a convenience wrapper around other modules, so that you can do everything with functions. I deliberately did not wrap the ImageFilter
functionality that also comes with PIL
.
For extra credit, utilize three of the predefined image enhancement filters in the ImageFilter
module (EMBOSS, FIND_EDGES, etc). The docs are here so you can figure out how to access and use it.