METIP Pixel Calculator Activities - Modifying Images

Pixel Calculator Activities - Modifying Images

by Lauren Bricker
Project Director: Steven Tanimoto
Department of Computer Science & Engineering,
University of Washington, Box 352350,
Seattle, WA 98195-2350 USA

Contrast

Contrast really refers to how different a pixel is from it's neighbor. Two pixels that are next to each other that have similar colors and close gray values are said to be low contrast. Here's an example of a low contrast part of an image:

	Zoom in to pair of adjacent pixels with a large difference in values.

What did you look for to find these pixels?

What were the pixel values?

Changing a pixel in the image

Now we're going to learn how to use the Rectangle Selection Tool and Calculator interface. Remember that higher pixel values show up as lighter shades of gray and lower pixel values show up as darker shades of gray.

Look back up at the toolbar. That's the thing that looks like this:

The bottom tool is the Rectangle Selection Tool.

	Load your favorite image by selecting File then Get Image.
	Zoom in until the numbers appear.
	Select the Rectangle Selection Tool from the toolbar.
	Draw a rectangle around some pixels by pushing down
               the mouse button and dragging.

At this point the Calculator will appear on the screen. The calculator looks like this:

	On the calculator, enter any number between 0 and 255.
	Click Compute.
	Zoom out and look at what you did.

What happened to the picture?

What happens if you enter 300, then compute in the calculator?

What else can you do to the image? (be creative!)

Adding to an image

Now we're going to learn how to use the calculator to change an image.

	Reload a new image of your choice using File then Get Image.
	Zoom in with the magnifying glass until the gray values first appear.

What is the letter of your first name?

	Now, WRITE THE FIRST LETTER OF YOUR NAME  by selecting 
	rectangles one at a time in the shape of your letter and assigning them new 
	gray values with the calculator.  Here's an example for the letter with gray 
	value 0.

How many rectangles did you use?

The # key

The # key on the calculator means "the value of every pixel in the selected rectangle."

	Reload a new image of your choice using File then Get Image.
	Select the whole image by drawing a rectangle around the whole picture.
	On the calculator, try the operation 255 - #, then press the Compute button.

So what did this do? It subtracted the gray value of every pixel in the image from 255.

What happened to the picture?

Back to Table of Contents


bricker@cs.washington.edu
Last modified: Monday 25 February 1996