assignments-programimagingsamples

Basic (very basic) versions of the assignment are available in

    /p/course/cs559-gleicher/public/2008ImagingDemos

better known as (for windows):

    P:\course\cs559-gleicher\public\2008ImagingDemos

Some sample data files are in there too.

1.@ A Basic Resizer

The basic resizer only implements point sampling / pixel replication. No prefiltering or interpolation.

    resize ski.tga ski_43.tga 0 4 3 4 3
![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_paint_in.jpg) ![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_ski_43.png)

Results from a less basic resizer doing upsampling (for a variety of filter kernels) are available here.

2.@ A Basic Linear Warper

The basic linear warper implements only point sampling - no pre-filtering or interpolation. A slightly less basic version implements linear interpolation (no pre-filtering).

	linearwarp ski.tga ski_r.tga 0 200 200 .8 -.8 .8 .8 100 -50
	   rotates and slightly scales
![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_paint_in.jpg) ![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_ski_r.png)
	linearwarp t0.tga lw0.tga 0 100 100 1 0 0 1 0 0
	   copies the source image (crops it to new size)
![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_t0.png) ![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_lw0.png)
	linearwarp t0.tga lw1.tga 0 100 100 .25 -.25 .25 .25 50 0
	   rotate and scale down (by roughly a factor of sqrt(2)/2
![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_t0.png) ![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_lw1.png)
	linearwarp t0.tga lw2.tga 0 100 100 .25 .25 0 .5 0 0
	   shrink and shear
![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_t0.png) ![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_lw2.png)
	linearwarp t0.tga lw3.tga 0 200 200 .707 -.707 .707 .707 0 0
	   note that this rotates around the origin!
![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_t0.png) ![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_lw3.png)
	linearwarp t0.tga lw4.tga 0 200 200 2 0 0 -2 -100 300
	   zoom and flip (centered at center)
![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_t0.png) ![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_lw4.png)

3.@ A Basic Painter

This is a very basic painter (the example program). It applies the brush stokes in a random order, randomizes their positions a little, and randomizes their output colors a little. The brush strokes are just diagonal lines.

    paint paint_in.tga paint_out0.tga
![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_paint_in.jpg) ![](https://graphics.cs.wisc.edu/Courses/559-f2008/pics/pub_pictures_paint_out0.png)

4.@ How big is this?

If you’re really curious: the basic versions of the samples (no fancy features) took me:

  • resize - about an hour, but I did some more complicated things to make it easier to add fancy features in the future. Its about 175 lines, with a little bit of comments.
  • linearwarp - about 75 minutes, with a lot of time spend chasing some bugs. its about 140 lines (with some comments).
  • paint - about 45 minutes, but I borrowed code from linearwap. its only 103 lines (few comments)

So you can see, the basic versions of these assignments is not that much.

That said, these were very basic versions (which is why they are so short). And I knew how to write them so that the code would be as simple as possible. You should probably expect to spend about 4 times the amount of time I did. (if you’re good, you can probably do the fancy versions in this amount of time).

Page last modified on September 18, 2008, at 10:04 PM