Computer Generated Space Scenes

Why

In an effort to get a better understanding of GIF files, I decided to write a program that generated them. But what should the "pictures" be of? I started with a 16 by 16 sequentially stored 256 color (randomly generated) picture:

ah, as you can see, its a tad on the small and useless side. So extending the "randomness" and making it larger, maybe even produce (accidentally) some nice "computer generated art" (note the lowercase), I went to 256 by 256 with randomly assigned colors:
Click to See 89K Sample
I don't know about you, but the picture above just looks like Noise to me. And the idea of looking at page after page of "Noise" pictures, on the off-chance of finding a "gem" was rather discouraging.

Being an avid Sci-Fi fan, I think it was only a matter of time till I stumbled on the idea of Space/Star Scenes, after all Stars are "effectively" randomly distributed (yea, yea, I know, not really, but they "look" like it). But alas, I didn't think of it first (I don't know if John Coleman or Kristen Smith suggested it). In any case, I liked it, therefor...

So, once I had "settled" on the idea of "Space/Star Scenes", the next question was how to make the pictures "mostly" black? It turns out (at least on my monitors) that black pixels "appear" much smaller than white (or other bright colors) pixels. Another way of saying this is that the white pixels "appear" much bigger than the black pixels (you can see this by making a black & white picture with random, but even, distribution). I don't know why this is, but I think it is related to some kind of "color bleed" "thing". In any case, after some trial and error, I found that to create a reasonable ratio of color pixels to black pixels, required a 1-31 ratio (i.e. for every colored pixel, I needed 31 black pixels).

After a little playing around, I had "settled" on using a "palette" of the 8 basic colors (generated by alternating the 3 color "guns", 2 * 2 * 2 == 8). I had a lot of "difficulty" with this whole "palette" thing. I started out trying to use the "system" palette (i.e. no Global Color Map in the GIF file), but alas, apparently, nobody (well at least not Netscape 3.0, Internet Explorer 3.0, or LView Pro) bothers to have a System Palette (the pictures all showed as Black)! The next problem was, OK, so I have to have a Color Map, other then: black, white, red, blue, and green; how does one "make" other colors? (I can't even "name" the 8 basic colors)

Now there are two ways to approach the 1-31 ratio problem. The first (and easiest for me to try with trial and error) was to leave the 256 color random generated picture, but "play" with the number of colors in the 256 "color" palette (this is the approach I used to "discover" that a 1-31 ratio "looked" best)(this resulted in the 8 basic colors, plus one white, and 256-9 more blacks). The second approach was to use 3 bits per pixel, and "skew" the "random" generated pixels heavily in "favor" of black (this of course would require me to modify by pixel generator, yuk). So, from my comments, you can probably tell which I chose, sorry about the resulting file sizes. A few of the GIFs in the "collection" are of this type.

However, even I (pulling them from my local hard disk) found these files a bit large, so I started looking for ways to "simply" shrink the files, but retain the ease of pixel generation. The first question I asked myself was, "do I really NEED colors?". So I started playing with strait black and white. After some more trial and error, I discovered that about a 1-15 ratio was visually "acceptable" (especially if the "1" part was the "least" used of 16 randomly generated colors). So the resulting pictures are made up of 16 (0-15, nibbles!) "color" (actually all black) pixels, that are "tracked" as they are added, and then the least used "color" is changed to white. Most of the GIFs in the "collection" are of this type. (Yes, I know these pictures could also be shrunk, potentially, by a factor of 4, so I "again" apologize for their size)

The next problem was, "How big should I make them?" I didn't want to make them all the same size, so I again fell back on good ole rand(). However, I didn't want to make a lot (or any for that matter) that were too small, so I settled on a 75 by 75 pixel minimum. If the resulting number was too small for the minimum, then I tossed it. If the random number was big enough I used the 256 (1-31) color routine, otherwise I used the 16 (1-15) color routine. Now some of the numbers generated some really big color pictures. However, as I wasn't crazy about the "really" big ones, I changed the code to limit the width. Most of these I tossed! (I left one of the resulting "big" ones for your comment, I personally don't care for it)

Now, why have I bothered posting these to the Net? Basically, personal vanity, in the sense of: "Look what I made!" And after all, you never know who out there will appreciate what. So, ...

I look forward to "hearing" your reactions...
George Smith,
SNS


Back to Intro



P.S. I will NOT give your email address to ANYONE! (unless you first OK it) So PLEASE vote!