The "Book of Guru" is one of my little projects. It's a chronicle of my achievements and my goals, and my little bits of anti-wisdom, written like a novel, in the second person. It's intended to be my way of showing how I see myself, and how I think that others see me. It's written like an ego trip, mostly because it is... :) But I wanted a way to tell people what I think, how I think, and why I think it. Every technical thing in it is clarified in Pseudo-Plain English. Something that I do with my self when I'm trying to resolve a problem. It's a work in progress, but I figured I'd share it anyway.
The Book of Guru, by The Guru of the Basement
"Bubba Gump Forever!", The Guru cried as he rushed into the heart of the battle.
His comrades where falling left and right, cries for assistance rang from his
fallen fellows. But The Guru continued on, pressing back his foes with great
skill. Suddenly 'zing, zing, zing', bullets where wizzing by him. Then "Thump!".
He leaned over to examine the wound, "Thump! Thump! Thump!" all was dark...
The Guru pulled out his weapon and started charging into the frey... "JM!!!" A
flash into reality... "It's tuesday... Time to take out the trash..."
Suddenly like out of a trance I saw The Guru break eye contact with the
phosphoresent screen.
"Ok Mom, Just a second...", He Replied. 'Tappity, tap, tap, smack' as The Guru
typed 'BRB Trash' into his computer. I watched as he lept from his chair to
respond to his mother's request. And it was quite a nice chair at that. A blue
chair with a 3 inch cushin, that mildly reminded me of a broken recliner. But
most noteable was the sign of The Guru's many hours entrenched in thought or
violence, two ovular impressions joined together at the back with a third.
'Thud, Thud, Thud' as he sprinted up the stairs so he could get back before
someone got mad at him for standing around. Alone, in his abode I took a glance
around. "Being hunted is like parinoia. Except that they are watching, and they
are out to get you..." came up on his screen as one of his teammates got board
waiting to respawn...
The Guru was a young man of 18, but if you looked in his room most of the usual
touches where missing. The wall adornings where of particular interest. Unlike
most teenagers his age, whose walls would have had pictures of their girfriends,
super models, and cars, his room was intead adorned with comic strips, maps,
reference guides, and instructions for baking a bread teddy bear. To give good
contrast to his rather immature wall content, his book shelves contained nothing
but college level electronic circutry textbooks, advanced programming manuals,
and low level computer architecture guides. With one vary noteable exception, a
book titled 'A is for Animal'.
It was late, the day had been different than usual, so he had had time to work
on playing his video games. Later that evening, he had been talking with his
brother about how the problem with the jumps he was getting with his optical
mouse where related to the picture on his mouse pad. He had been discussing how
a pattern of irregularly shaped black dots on a white background would be the
best. So him and I went into his room and he started tapping away at the
keyboard. After 5 minutes he had a program that made a simple dot pattern. I
turned to him and said, "Not very pretty, is it?"
"No" he replied. He continued, "But... What if we where to bias the dot pattern
based on the intensity of a pixel in a picture... Then the mouse pad would have
a dot pattern, that when looked at by a human, would look like a picture. Yes!
That's it!" and 'tappity tap tap' 5 more minutes later we had a window with 2
boxes on it. One with a picture and one blank one. "Now, watch this," 'Click'
and the image began appearing. To my amazement, a simple black and white picture
appeared from the ether, and it looked just like the origional picture, black
and white of course. He looked at me, back at the screen, then me again, and he
said, "You know what this is?! I've just developed error diffusion dithering
from scratch!" and raised his hands up in triumph.
"Huh?" I said.
"Error difusion dithering. It's when you take a picture and try and represent it
using dots based on a probabilistic model."
"Oh, that helped alot..." I stated scarcasticly.
"Uh, ok. Let's try it this way. We wanted black and white dots right?"
"Ya..."
"Ok, so what we've done is place more dots where the color is darker, and fewer
where the color is lighter. That way when you look at it, it looks like it's
darker or lighter based on the number of dots in a given area."
"Oh... Ok."
"You get a 'Grayscale' image only because your mind tries to mix the dots
together. Artists have been using this technique for a while. And computers have
been doing this since back when they could only do black and white anyway."
"Cool."
"But you'll notice. We've achieved our goal. It's an image consisting of
irregularly shaped black dots on a white background. And even better, it's
pretty, so that people won't mind it being there. Now, we've caused a new
problem, wherever the picture is really bright there's no dots. So how about we
use little blue dots placed randomly, maybe once out of every 8 dots... That way
it won't darken the image too much."
"Uh, whatever," I said.
And so some more typing, and 5 minutes later 'click' and a black and white image
apears with little blue dots scattered through-out. It was now a little blue in
general, but otherwise it was a pretty good likeness of the origional picture.
After trying a few more pictures I told him that I had to go home, so we said
our goodbyes and I left. I spent the whole way home thinking about the "Error
Diffusion" thing. It made sence, and I figured I'd ask him about maybe trying
that with color sometime. Boy, should I have stayed... When I came back the next
day after school I went over to his house. I found him down in his room with
pencil and paper, mumbling to himself, "Now the distance from the RGB
corridinate to the nearest miss would be the square root of the sum of the
difference of the three color vectors..."
"JM?" He Jumped as a spoke.
(Breathing Heavily) "Oh Hi! Nice to see you've come over. I have something I
want to show you. Look at this," he said and showed me a paper with a bunch of
boxes with dots in them and lines connecting all the dots to a particullar one.
Each line had a number on it, and every dot had three. There where also circles
drawn, with their centers placed around the dot that all the lines connected to.
"It's a method for Color to Color dithering. It uses a distance based method for
determining a weighted probbility tree. Then a color is selected at random and
then rendered."
"Your speaking in gibberish again," I said with a frown.
"Oh, sorry. You know what a pie chart looks like don't you?"
"Ya,"
"And you know what a dart board looks like also?"
"Well duh," I said in disgust.
"Well, what this does is takes every dot in a picture and breaks it up into it's
three light components, Red, Blue, and Green. Then it uses those colors as if
they where coordinates in a 3D space. So, for example, The color red would have
the coordinate 255,0,0 where the range for each value is 0 to 255 and the the X,
Y, and Z represent the values for Red, Green, and Blue respectively. Then we
take those and calculate the distance to all of the colors that we have to work
with, like Yellow, Red, Magenta, that kind of thing. Then we use those distances
to make a pie chart. The Closer something is, the bigger it's slice of the 'pie'
it gets. Then we pretend that the pie chart is a dart board, and throw a dart at
it. The closest color should be hit most often, but if the color that we're
trying to represent is Rose, which is kind of a whiteish red, then the white and
red colors may have the same size slice of the pie. So we should get mostly red
and white dots. Which make rose, roughly."
"Cool! Do you have something that does that written?"
"Actually, yes. And it works nicely. Look," he said as he pressed some buttons
and brought up a window with two picture windows in it. The left one had a nice
picture of a circut board in it, and the left one was blank. He clicked a button
on the form and a picture started to evolve. He was right, places where the
color was halfway in-between there where a majority of the two colors in the
picture. It looked pretty nice.
"Amazing!"
"Ya, I think it's pretty impressive also. I had to tweak the methodology a bit
though, because, as you should have already 've noticed, ANY of the possible
colors can appear, not just the closest one. So I had to bias the weighting a
little bit to get it so that the other colors came up VERY rarely. I did that by
taking the distance and raising it by a power of 7. I had to guess-and-check the
value, and I found that 7 works nicely."
"Wow..."
"I know, it's pretty wow isn't it." That night I just couldn't help but think,
'Where does he get this stuff?'
