CSE 457: Introduction to Computer Graphics

[Mt

Project 1: Impressionist

Date Assigned: Monday, October 13, 1997
Date Due: Monday, October 27, 1997
Artifact Due: Wednesday, October 29, 1997

Project Description

Impressionist is an interactive program that creates pictures that look like impressionistic paintings. It is based on a paper and a program by Paul Haeberli. You can find a Java implementation of his program here .

To create an impressionistic picture, the user loads an existing image and paints a sequence of "brush strokes" onto a blank pixel canvas. These brush strokes pick up color from the original image, giving the look of a painting. To see some samples that were generated with the sample solution, click here.

Project Objective

You will add the functionality to a skeleton version of the Impressionist program, which we will provide. The purpose of this project is to give you experience working with image manipulation, OpenGL primitives, and user-interface design.

Getting Started

Click here to run the install program, or make a copy of the files located in /cse/courses/cse457/projects/impressionist. Then compile and link the program by typing "make" at the command prompt. This will produce the skeleton program.

Explanation of the Skeleton Program

The skeleton program we provide does very little. It allows you to save and load a bitmap, and it shows the "canvas" you use to create the impressionistic painting.

You can find some sample bitmaps in /cse/courses/cse457/projects/impressionist/bitmaps

Required Extensions

You must add the following features to the Impressionist program:
  1. Implement 5 different brush types: single line, scattered lines, scattered dots, circles, and scattered dotted lines.
  2. Add sliders to control various brush attributes. You need to include sliders for the brush diameter, line thickness, and brush angle.
  3. Add the ability to control the brush direction. The stroke direction needs to be able to be controlled 3 ways: using a slider value, using the right mouse button to drag out a direction line, and using the direction of the brush strokes. Use a radio box to allow the user to select which method to use.
  4. Allow the user to change to opacity (alpha value) of the brush stroke. When painting, one color sometimes mixes with the color underneath to produce a new color. Changing the alpha value allows one to simulate this effect.
To see what these features should look like when they're done, you can look at the sample solution here . Your implementations of brush strokes, brush direction controls, etc. do not have to behave exactly the same as the sample solution, but they should be fairly close. Also, note that the sample solution does more than you are required to do (i.e., it implements some of the bells and whistles).

Project Artifact

When you are done with this project, you will create a project "artifact" to show off the features of your program. For the artifact for Impressionist, you will create an impressionistic painting from an image of your choice. We will then create a gallery of all the paintings on the course web page.

Bells and Whistles

Here is a list of suggestions for extending the program. You may also think up and implement some of your own extensions.

[Whistle] To give your paintings more variety, add some additional brush types to the program. These brush strokes should be substantially different from those you are required to implement. You will get one whistle for each new brush.

[Whistle]
OpenGL limits the size of GL_POINT objects to about 10 pixels. Thus at some point, increasing the brush diameter of the "circles" brush won't result in bigger circles. Allow the circles to grow larger than 10 pixels by using a GL_TRIANGLE_FAN to implement these circles.

[Whistle]
When using your program, you currently can't see what part of the original image you're painting. Extend the program so that when you're making a brush stroke, a dot appears on the original image showing where you're painting.

[Bell+Whistle]
A different solution to the problem of not being able to see where you're painting is to show a dimmed version of the painting on the canvas. Add a slider that allows the user to fade-in or fade-out the original image beneath the user's brush strokes on the canvas.

[Bell+Whistle]
To make your painting more interesting, add "alpha-mapped" brush strokes. In other words, allow the user to load a bitmap representing a brush stroke. This bitmap would contain an alpha value at each position. Then when this brush is used to draw, a single color would be selected from the image, all pixels in the brush bitmap would be set to this RGB color (without changing the alpha value), and this partially transparent bitmap would be painted on the canvas. A new color would be used each time the brush is drawn.

[Bell+Whistle]
It can be time-consuming to paint an image manually. Add a feature so that a whole painting can be created automatically. The user should only have to specify a brush type, size, and angle to use. Then the program should automatically paint brush strokes over the entire image, using a randomized brush order and varying the brush attributes slightly as it goes (to increase realism).

[Bell+Whistle]
It would be nice if the direction of brush strokes were somehow automatically determined. Allow the user to load two grayscale images, one representing the x-gradient to use and one representing the y-gradient. Then add a button that will cause the direction of brush strokes to be determined from these gradient images.

[Bell] [Bell]
The "accuracy" of the painting can be also be improved by clipping long brush strokes to edges in the image. Allow the user to load a black-and-white image that represents the edges in the picture. Then add a checkbox so that the user can turn on edge-clipping, which will automatically clip brush strokes at edges in the image.

[Bell] [Bell] [Bell] for first, [Bell+Whistle] for second. Instead of just loading images that represent the edges or gradients in an image, use image processing techniques to automatically locate the edges or find the x- and y-gradients in the image.

[Bell] [Bell] [Bell] [Bell]
Extend the Impressionist program to work with video. The user should be able to load a series of images from a video and setup some initial parameters, and the program should automatically generate an impressionistic version of the video. The video should exhibit temporal coherency.