cs4388


wk 6 case studies David McAllister


Biography

David McAllister has been programming computers for twenty-five years, since the age of nine. Computer Graphics has been his focus since the end of high school when David received his first job in the industry testing 3D APIs at Evans and Sutherland. In 2002 he received a Ph.D. in Computer Science from the University of North Carolina at Chapel Hill, the number one ranked graduate program in computer graphics.

Artwork Highlight:





Computing Process:

Genetic art:

This is genetic art. It is similar to or the same as evolutionary art, algorithmic art, or organic art. A genetic art image is defined using an equation or program that computes the color of each pixel (dot) in the image. The equation and its parameters are chosen randomly. The artist then chooses the best random images. These equations defining the best images are then used as parents and mutated and crossed over to create a new batch of child images. In this way the images tend to go from simple to complex and from less to more pleasing over time.

He originally wrote this program as a diversion during grad school in 1998. The images displayed in this gallery are descendents of those 1998 originals. Many have descended hundreds of generations. He has probably looked through a quarter million images over the last six years to create these.

Line:

The way the program works is it randomly generates some mathematical functions of x and y (such as 5 + cos(2.3 * sqrt(y + 1.1) - x)) and converts them into a picture. There are several ways of converting the equations to a picture. In the program available here, this conversion is done by evaluating the expressions with different values of x and y for each pixel in the image and converting the resulting number or numbers into the color at pixel x,y.

Color

He randomly choose one of three different ways to convert the equations to a color:

1) By making three functions representing the red, green, and blue primary colors that combine to form the color;

2) By making three functions representing the intensity, redness, and blueness (YCrCb); or

3) By making one equation that is an index into a genetically evolved color palette.

Genetic programming follows Sturgeon's Law - "Ninety percent of everything is crud," so this randomly generated expression will probably be boring and ugly. So He compensate for the probability of ugliness by generating lots of pictures, some of which will be interesting. The program displays an array of images and the artist can mix and match these images to get better ones. This is where the genetics comes in. Think of the images as an evolving population, whose fitness for survival is the image's appeal to the artist. The artist can enter a numerical score according to how much they like each child image, or can click on the most appealing images to select them as parents of succeeding generations. Then when the artist has selected all desirable children, the undesirable ones are replaced with a new generation of children. The new images are either randomly generated or are a mutation of one, or a cross between two existing images that have been designated as parents.

The population gradually evolves into more and more pleasing pictures. The artist will often choose a particular motif that pleases them and breed it over and over trying dozens of variations and crossing it with everything that looks interesting.

Analysis:

Genetic Art is using half computer and half human way to create the Art. It provides an easy way for artist to create the art from simple to complex via selecting the good and filtering the bad element. This is very useful.

Link:

Genetic art: http://home.comcast.net/~davemc0/GenArt/

Appendx:

Program spec:

DaveMc's Genetic Art Program, Version 2.0

Copyright 1998 - 2004 by David McAllister

Genetic art is represented as a set of one or three equations that compute the color of each pixel in the image based on its x,y coordinates. The genetic part is that the resulting images are given a score based on how much you like them. This score is their fitness to survive. The higher scoring individuals are then selected as parents of a set of children that are created through cross-over and mutation of the parents. Repeating in this way causes the images to keep getting more and more pleasing.

Genetic art was the idea of Karl Sims in 1990. There are about a dozen different people out there who have written programs that do it. Mine is now one of them.

=============================================================Starting the Program

The file format for storing the equations that make the pictures is .GNX. It's actually a text file. Each individual is four lines long. You can start the program either by itself or by dragging one or more .GNX files onto the program's icon. The program will take several seconds to load the file and will then draw the main program window and start drawing the individuals.

If you start the program by opening a file it will save back to that same file. It first makes a copy of the original file called filename_old.gnx. Each time it saves, it keeps the previous copy around as filename_bkp.gnx. Everything is autosaved once every four times you press the space bar.

=============================================================Using the Program

The program has two windows. The black DOS window prints stuff out. The main window is divided into three subwindows. From top to bottom they are the Child Window, the Parent Window, and the Zoo.

The Zoo

The zoo is on the bottom. It shows every individual that currently exists, including those also shown in the Parent or Child windows. Since you may have several hundred individuals in your zoo, you can scroll this window using the UP/DOWN keys or the PAGE UP/PAGE DOWN keys.

Left click an individual to select it as a parent.

The Parent Window

This is the little window in the middle. Click on individuals to put them here and let them be chosen as parents of new individuals. To send a parent back to the zoo, just left click on it.

When a new child is to be created, one or two parents are chosen from the parent window based on their scores. An individual with a score of 0.8 will be twice as likely to be chosen as an individual with a score of 0.4. Once the parents have been randomly chosen the child is created via mutation and cross-over. Portions of one individual are discarded and portions of the other are spliced in their place. This is done to the three equations and to the palette. Mutation is done by discarding part of an equation and putting a new random equation in the empty spot. The new child will have a score of 0.01.

If nothing is in the parent window, the new children will be created randomly. Many of these first generation ones look very boring. About one out of five new children are created randomly, even if there are parents available. This is supposed to increase the amount of variety.

The Child Window

This window is at the top. It contains the new individuals that have not been scored yet. You can tweak these as described below, or delete particularly ugly ones by clicking the middle button. But usually you choose the few that you like, then press SPACE to delete all the rest and make new ones.

With the ones you like, press '1' through '9' to give them a score of 0.1 through 0.9. This will also move them out of the Child window into the main zoo. Left clicking on them will will give them a score of 0.5 and move them into the parent window.

The window title contains lots of information. If it starts with "AA" it means it's doing some background rendering. If you press 'A' it will turn that off for a little while.

The first number is the index number of where in the zoo the selected individual is. 0 is at the top.

The next number is the individual's unique ID number.

Then comes the score. The "AA=1" means that this one hasn't been smoothed yet. When it has, it will say "AA=7". If you press 'j', then it will be re-rendered with 30 more samples per pixel and say "AA=31".

It then tells you the kind of image this is (RGB/YCrCb/ColorMap).

Next is the Generation. Images made from scratch are generation 1. Their children are generation 2 and so on. The child of two images with generations 5 and 12 will be 13. If a really nice image says generation 1, it's been around since before I started keeping track of lineage.

The next numbers are the unique ID numbers of the parents. If one of the numbers is -1, it means that it was a mutation of only one parent. If both numbers are the same, it means it was a cross-over of that parent with itself. If both numbers are -1 it means this individual has been around since before I started keeping track of lineage.

Finally, the title tells how things are sorted - by score, ID number, or generation.

=============================================================

Operations

Many operations work in all three windows:

Right Click Get a menu and a reminder of what keystroke does each thing

Space Bar Delete everything in the Child window and create new children. This also re-sorts everything. It also saves everything once every four times.

'e' Save all individuals to the .gnx file

't' Sort all individuals. This cycles between three ways of sorting:

- by score (biggest at the top)

- by unique indivdual number (oldest at the top)

- by generation number (earliest at the top)

'A' Toggle background rendering on/off. When on (the default) the program will first compute the image of every individual, even those not visible on the screen. Then it will recompute them all with antialiasing (smoothing) enabled. High quality antialiasing using 'j' is also done in the background.

'F' Reset scores of every individual to 0.01

'R' Measure how many different colors are in each individual and assign scores based on colorfulness. This isn't very useful.

'q' or ESCAPE Quit the program (You should press 'e' to save first.)

The following operations work in any window. They apply to the individual the mouse is hovering on when the key or menu item is selected.

Middle Button Delete this individual permanently

'0', 'd' or DEL Delete this individual permanently

'1' - '9' Give this individual a score of 0.1 through 0.9

'p' Print the equations and other info for this individual to the text window

'D' Delete everything from this individual in the zoo and lower. Be careful with this.

's' Save a medium-quality 512x512 image of this individual to disk. This may take a while. The filename will be G000xxxx.jpg, where the xxxx is the individual's unique ID number.

'S' Save a high quality 2048x2048 image of this individual. This may be VERY SLOW. It can take from 1 to 15 minutes.

'o' Save this and all images after it in the zoo at 512x512 resolution. This will take ALL NIGHT if you have lots of images.

'O' Save this and all images after it in the zoo at 2048x2048 resolution. This will take ALL NIGHT if you have lots of images.

'<' '>' Decrease or increase this individual's score

There are operations that tweak the appearance of an individual. These operations apply to the individual the mouse is hovering on when the key or menu item is selected. The pictures can be represented in one of three basic ways. They can be an RGB (red/green/blue) image, a YCrCb image (where the three values represent the brightness and chrominance), or a ColorMap image where the red channel tells which color from the palette to use at each pixel. Some images also use another variable, t. If the individual uses t, you can change t to slightly vary the shape of the image.

'r' Copy the red channel into the other two

'g' Copy the green channel into the other two

'b' Copy the blue channel into the other two

'x' Replace a little bit of the palette with a random color

'X' Replace the whole palette with random colors

'c' Cycle between RGB, YCrCb, and ColorMap styles

'C' Replace all the random numbers with slightly different ones (tweaks the shape of the image)

'j' Smooth the image a lot

LEFT/RIGHT Increase or decrease the t value (tweaks the shape of the image). This doesn't always make a difference.

When tweaking, it is a good idea to make the individual a parent, create a bunch of children, and tweak a child that looks like the one you're interested in. This will prevent you destroying the one you like.

An example of tweaking is to press 'c' to view the image in all three color modes. In RGB mode, if you can tell that only one of the channels is doing anything interesting, press 'r', 'g', or 'b' to make a gray scale image based on that channel. Then press 'c' to switch to palette mode. Press 'X' until it creates a palette you kind of like. Then press 'x' and hopefully it will make the palette even better. Press 'C' or the left/right arrows to tweak the shape a little bit.

0 Responses to “wk 6 case studies David McAllister”

Post a Comment



© 2006 cs4388 | Blogger Templates by GeckoandFly.
No part of the content or the blog may be reproduced without prior written permission.
Learn how to make money online | First Aid and Health Information at Medical Health