&image-mosaics-prefix;Algorithmic Image MosaicsDue: &image-mosaics-due;
Summary: In this assignment, you will use the
basic pixel-manipulation techniques to create simple color mosaics
from source images.
Purposes: To give you more experience working
with the basic pixel operations in the GIMP. To help you think about
colors. To encourage you to build non-representational images.
Expected Time: Two hours.
Collaboration: We would prefer that you work
in groups of size three. However, you may work alone, in a group of
size two, or a group of size four. You may discuss this assignment
and possible solutions with anyone you wish. If you discuss this
assignment with people other than group members, make sure to include
a citation (e.g., I consulted this person,
who helped me do this).
Submitting:
Email your answer to &grader-email;. The title of your email
should have the form &image-mosaics-subject; and
should contain your answers to all parts of the assignment. Scheme code
should be in the body of the message.
Warning: So that this assignment is a learning
experience for everyone, we may spend class time publicly critiquing
your work.
Background
You now know a few simple techniques for dealing with
raster graphics and the pixels through which we can describe
raster images. In particular, you can load an image with
image-load, create a new image with
image-new, get the value of a pixel at a
particular location with image-get-pixel,
set the value of a pixel at a particular location with
image-set-pixel!, and determine the width
and height of an image with image-width and
image-height.
What can you do with this simple suite of procedures? One potentially
interesting activity is to build new, simple, images from existing
images. For example, you can take a small selection of pixels from
one image and use those to build a new image- Such created images are
a form of algorithmic images, images created by
algorithm, rather than by hand.
Assignment
a. Write a procedure, (image-mosaic-1
"image-file"), that builds and returns a
new 4x4 image, each of whose pixels is taken from the image stored in
"image-file". Which pixels should you choose?
It is up to you. One natural technique is to divide the original
image into sixteen portions, and take the middle pixel in each quadrant.
b. Pick at least three images and generate mosaic images from them.
Identify one that you find particularly appealing.
c. If we're going to divide the image into sixteen quadrants,
it might make sense to let the client specify where in each quadrant
to grab the pixel. Write a procedure,
(image-mosaic-2
"image-file" hoffvoff), that divides the given image
into a 4x4 grid and then builds and returns a new
4x4 image, each of whose pixels is taken from the pixel offset by
hoff and voff from
the top-left corner of the corresponding part of the grid.
For example, supose our image is 100x200. All segments of the grid will
have width 25 and height 50. One segment of the grid will start
at (0,0), another at (25,0), another at (50,0), another at
(75,0), another at (0,50), another at (25,50), and so on and so forth.
If hoff is 3 and voff
is 7, then the pixel we take from the segment starting at
(25,50) would be at (28,57).
Important Evaluation Criteria
We will primarily look to see if you've tried something creative in
choosing the pixels. We will also consider whether the algorithm you've
come up with does anything interesting with typical pictures
(whatever those are).
Submitting Your Homework
Please submit this work via email. The email should be titled
&image-mosaics-subject;
and should contain your answers to all parts of this assignment.
Please include your Scheme work as the body of an email message.
Attach one source image and the corresponding result image.