Monday, December 20, 2010

Sketch-a-bit Fine Art

On December 13th, Sketch-a-bit hit 20,000 sketches!

Sketch-a-bit is a collaborative/evolutionary sketching app for Android that Adam and I made and launched back in March. Sketch-a-bit consists of an ever-growing pool of 'sketches' (now >20,000). A user downloads a random sketch, modifies/erases/enhances that sketch with a light or dark chalky pen tool, and then uploads the new sketch to the pool. Essentially, instead of starting from a blank white canvas, you get to start from someone else's doodle (or masterpiece). Since all images forever are saved and from the website, we can track how sketches evolve. Check out this tree, and its parents and children sketches.

Here's a picture of the 20,000th sketch evolving from The White Square... sketch #0.

So, lots of sketches! All black and white. Some really awesome. Some penises and other assorted human anatomy. A lot of stuff that's just sort of abstract or sketchy or doodley. The question is, can we make a poster that shows off a lot of the sketches at once? What would make the poster look as cool as possible?

Idea: Use sketches as pixels in a huge rendition of another sketch! 

spiral sketch made of more sketches

So we did! See a kind of reflective shot of the poster hanging up in my apartment. 


Step 1: Sort images by brightness. (Sum most/all pixels in either the original-sized images or thumbnails.) This yielded a gradient.

Step 2: For each pixel in the Chosen Sketch (i.e the above spiral, sketch #12), randomly pick a sketch in the right intensity range. This can lead to duplicates, either because the same random sketch is picked for the same intensity, or because someone uploaded a sketch without changing it and the sketch itself is a duplicate.

Step 3: Make a bigass mosaic. We used 128-pixel-tall JPEG thumbnails because the original 320x480 PNG images were a bit too hefty. Keep in mind that the Chosen Sketch has the same aspect ratio as the rectangular pixels, so to get things to work out, we actually just need a square NxN grid of little sketches. The other thing is that we wanted to print at 300dpi (dots or pixels per inch). This means that the little 128-pixel sketches get to be, at most, a little less than half an inch tall when printed. We used the Python Imaging Library (which used to go by PIL even though you import Image in python) to stitch all the images together and ended up with a rather large single JPG file just about ready for printing.

Step 4: Weed out the nasties... because these sketches contain all sorts of 'fun' things and I don't really want people's crappy sketches of genitalia hanging on my wall forever. Adam did this. He didn't catch everything, but he got nearly all of it. Also, there were only ~400 nasties out of 20,000 images. Just 2%! If you just want to enjoy the obscenities, here you go.

Step 5: Make it real. I opened the final JPEGs in Photoshop, made them the right size and right dpi, and then printed them. Originally, we planned to make a 40x60 print, and we asked a framing shop how much it would cost to frame. *cough* The answer: bizillions of dollars! I mean, >$400. They had a snazzy wooden laminate option, which wasn't any cheaper, but was really pretty. In the end, we bought a big 20x30 frame from Goodwill for $15. I just wanted to say that picture frame hardware is pretty interesting! Sproingy braces and other metal corner braces and hanging wires...

Here's one of the smaller (printed on a normal laser printer) final products:
Framed "whorls"

Finally, have at some of the files yourself!
-- 100x100 sketch tree (dirty): 51MB
-- 74x74 sketch spiral (clean): 35MB
-- 32x32 sketch whorls (clean): 2MB
-- flower, eye, and pen (1-3MB each)

Tuesday, November 30, 2010

ONE MILLION 3D points in Flash

I've been playing around with Flash lately and thinking how to take PhotoCity models to the next level.

I wanted to make a flash-based online model-cleaner-upper, where a user could erase errant points from a dense point cloud. Here's a dense point cloud loaded into flash with the same interaction capabilities as the PhotoCity 'swisher':

Amazingly, there are ONE MILLION 3D POINTS floating in space in that little Flash applet. Unfortunately, there are 6M points in that particular model, and just the 1M points made my computer pretty angry.

I decided to write a blog post instead of implementing the point-erasing, because (I'm sleepy and) I'm not sure I should be going down the Flash route for dense point cloud editing. Maybe/YES for sparse point cloud/bundle editing, though!

Tech specs: I'm using the Sandy 3D engine (a custom StarField, specifically) to draw the points.

Thursday, November 4, 2010

TIGjam Day 4 and Night Hike

Like I mentioned before, in addition to TIGjam just generally being awesome and inspiring, it was also really productive. This post is about the game/experience that I produced, and how it evolved from a little nugget of an idea.

Whenever I go hiking with Adam, at some point or another during the trip, the conversation turns to talk of making a hiking simulator. On the fancy end of things, hikers would wear backpacks with cameras/laser scanners/microphones mounted to them and record as much of an actual hike as possible. This would perhaps allow someone else to virtually experience the hiking later. On the simpler end of things is something like our Night Hike: a hiker walks along through a rich, beautiful environment and encounters a variety of sights and sounds.

night hike version 3

I had spent the first day of tigjam getting more acquainted with flixel. (Adam spent the day writing a paper.) I made a few demos (described in a previous post) like a broken pong game and a thing where a guy sort of ice skates around, but I didn't have any brilliant, complete game ideas. But! Late that night! I said to Adam that we should make the (simplified) hiking game that he's always talking about. Vanquish that headcrab...! (Headcrab here being a nagging idea that wraps around your brain until you bring the idea to fruition.)

The project seemed like a good size for tigjam: we could get something finished in a few days, yet there would also be tons of improvements and new ideas to expand upon if/when we had time. Here's the evolution of night hike:

1st night hike sketch

Aesthetics of night time and silhouette stuff decided on fairly early. As you can see in the sketch, we did sort of talk about how the game might end. Perhaps, after walking all that way in the dark, you'd come to the warm glow of a lit up tent or campfire. Maybe, when you walked into the light, your face would be turn out to be horribly grotesque! The end in nighthike right now is jut that you walk off the edge of the screen after moving right for about 10,000 pixels.

I drew up this picture of how the whole scene might look:


Adam sketched out all these additional layers:

adam's proposed night hike layers

He also drew this picture, which except for the wormy caterpillar hiker blob, sort of put my drawing to shame.

night hike (layer compositing mock-up)

Great. So, our aesthetic style is in order. At this time, I was working on making the terrain randomly generate itself and let the character walk along it forever. This is the first hikable night hike, with pokey mountains everywhere:

night hike in the very beginning

Soon, the terrain-walking improved. I gave up procedurally generating the distant mountains (for now) and just drew them. I also drew some grass and a tree and planted those in the scene. The second version can be played here:

night hike version 2

In between the second and third versions, I think we added new trees, a single sound, more hilly terrain, and a dark fringe effect. The game got a little tooooo dark, so I added a 'lightning key' -- 'D' and a fast-walking key -- 'F' so I could see all the trees more easily and dash along the world. The third version can be played here:

night hike version 3

While I don't expect the current version to suck you in and keep you entertained for very long (it is no dolphin olympics 2, nor dino run) I do hope you find it kind of pretty and soothing! Maybe some day I will make that hiker's world a bit more interesting... more explorable... and more treacherous!

Wednesday, November 3, 2010

TIGjam day 3 and the games

TIGjam day 3 and the games

So what happens when you put 50 game developers in a room for four days? They make games! On the third day, I wandered around and peered over peoples' shoulders to see what kinds of games they were making. There was also a pretty epic Madhouse tournament on saturday night. Even though the fourth day was when we actually showed off our games to each other, I feel like lumping game blurbs into my official 'day 3' post and saving 'day 4' to talk about what I made.

Here are some of the games I happened to remember, ordered by proximity to where I was sitting at a table in the back of the room:

Digging in the dirt a la minecraft and motherload
kinda-like-minecraft games!

Both Santiago and Tim were making games like this. Tim's game (made with Flixel) featured fancy HDR lighting where the outside light shone down into caverns and if you lighted a torch deep in a cave, there would be a bright flash and then your character's eyes would adjust to the new light. Santiago's version was made in HTML5 (and/or javascript), I think, and could run in any web browser. It had textured tiles just like the ones in Minecraft, and even the appropriately textured main character and the green explodey creatures.

Honey Time
Also at the table, Amanda made a game for the iPad with bees flying around, visiting flowers, and returning to the hive to deposit honey. The game was a lot like Flight Control, where you touch a bee and draw out the path you want it to take. It was more complex than Flight Control, though, because bees had to go to multiple flowers of the right color before going to the hive, and if they got too close, they wouldn't crash, but they'd get distracted and fly around each other for a while. I'd been talking to my parents about game ideas before I went to TIGjam, and my mom, who does beekeeping as a hobby, had totally suggested a game with bees and honey. I guess she needs an iPad now to play Amanda's game.

Space Bus
At some point during the second day, Adam had drawn a nice starry night scene as a prototype for Night Hike, and this sparked inspiration for Ben's game.

The main chunk of inspiration, though, is Penn and Teller's Desert Bus (watch a video here: where you're driving a rickety old bus from Tucson to Las Vegas in real time, a drive that is painfully straight, boring, and about 8 hours long. After driving the bus for 8 hours, you earn one point and are asked if you want to drive back to Tucson. Additionally, the bus veers to the right, so you actually have to keep steering to keep it on the road. Otherwise, it drifts off, overheats, breaks down, and you get towed back to your starting destination for the same amount of time you spent driving.

Ben decided the bus had made the Tucscon/Las Vegas trip enough and that it was time for something a little more substantial. How taking the bus to Alpha Centauri, the closest star besides the sun, which is just a mere 4.37 light years away? Ben taped off the steering wheel, installed a joystick, and upgraded the bus to travel at about 45 million miles per hour. At that speed, it'll only take about 60 years to reach its destination! Better not drift off course though, otherwise a space tow truck will come and take you all the way back.

space bus art in progress

I took a sneaky picture of Ben working on the art, but maybe we'll see the finished Space Bus pop up on the internet some time soon.

The mustache game
Okay, moving away from my local tigjam neighborhood/table now. Somewhere on the other side of the room, an amazing mustache game was forming, based around the absolute truth that everything is better with mustaches. In this game, heads would bobble on by behind a fence and you would shoot cute little mustaches onto them.

Platform Party
Not only did Daniel put together this nifty procedurally generated platformer, but he also, I think, built the web-based Pixie game engine that he used to make the game. Try the game out here!

Unlike many of the other games, this game had been under development for about 6 weeks already and was mainly working on polish, play testing, and fixing of final bugs. I don't want to explain too much about it because playing it and figuring it out is part of the experience, but I'll say that it's got puzzles and platforms and a pair of players. It should be online and playable soon.

Madhouse Tournament
madhouse tournament

Day 3, 1am to 3am, we had an epic Madhouse tournament. The internet says that Madhouse is a "bloody top down shooter with rpg elements." Also, it makes a great tournament game, especially when combined with commentary from the game's creator, Paul Hubans, himself. I was especially impressed with the variety of characters, environments, power-ups and special abilities. There were also a fair number of glitches, like characters getting stuck in walls, but that made the event all the more interesting. Probably the most epic match was Amanda vs. Tim, which actually came down to a tie with both characters getting their 5th kill at the same time, and then Amanda shooting Tim in the tie-breaking dual. You can watch a video of part of their match here.

And that wasn't even all the games! There were so many more! This Randy O'Connor fellow blogged about more of the games, including Night Hike, which is the one that Adam and I made.

Saturday, October 30, 2010

TIGjam Day 2 and Photos

I decided on a game with Adam, which is to be announced later. The game includes a lot of scrolling to the right and is more about 'the experience' than winning or losing. But it's not an art game! (Or is it?)

We're in between TIGjam days 2 and 3 right now. I am currently blogging from my parents' house because I slept A LOT, which I needed. Yesterday was excellent (more learning, more lively than Thursday) and I bet today will be awesome, too.

This is about what TIGjam looks like during the day:

This is what TIGjam looks like when you stay around until 1am:
Playing games late at night

Two observations about TIGjam:
1. It's a lot like SuperHappyDevHouse, except it actually seems a lot more productive. Maybe because EVERYONE is working on games? Probably because it's 4 days instead of 1 and you feel like you could actually complete something in that time.

2. It's a lot like my lab at school, and damn, I am really lucky to get to make games for my PhD. [I'm a computer science PhD student at UW and my lab makes games like Foldit, Photocity, and Refraction.] I am surround (at TIGjam and at school) by people making games (mostly in Flash), artists, people chatting, people chatting about games. Sometimes there's too much going on and it's hard to work, but it's totally interesting and inspiring if you stop working and pay attention to the conversations around you.

Friday, October 29, 2010

TIGjam Day 1 and learning Flash and Flixel

So, I went to the first day of tigjam 3 today! It continues tomorrow and all through the weekend. Pictures and stuff later; for now, I just want to talk about what I've learned so far.

I started learning flash just a few days ago. That may seem like not very much time, and while I haven't made that many games in my lifetime, I have used a brand new technology for just about every game, so I should be pretty good at learning this stuff. (Some games I've made organized by tech: c++/opengl, assembly, python/pygame, java/home brew game engine, python/twisted/mysql/shell scripts/php/an entire cluster of machines)

The setup for today:
Language in: actionscript3
IDE: flash builder 4
Extra libraries: flixel (
Flavor of computer: mac

As it turns out, Flixel has a lot of the elements I saw before in PyGame and even ODE. There is a main event loop, and some combination of 'move objects', 'detect collisions', 'get user input', 'draw stuff to the screen' happens each timestep.

As I acquired more and more skills throughout the day, I made two not-really-games which are not even worthy of posting online, but which I'll show you pictures of. The first game was Pong, because I knew undergrads at my school in a games capstone class started out with Pong. I got on screen text, moving paddles, a particle emitter, "scores" (score a point for hitting the ball with the paddle)... and then I got bored and moved on to other things.

The second non-game involved an animated sprite (and sprite sheet), keyboard controls again, and drawing a trail behind the player as it moved. You could basically get this little guy that wiggled his arms to skate around the screen an occasionally drift off and be lost forever.

Lessons learned:
- Oh my god don't forget to add "super.update()" in the appropriate places. Why doesn't collision work? Why isn't my sprite at the right place? Why do I have to update each sprite manually? All questions that are answered with a well-placed super duper super.update().
- Animated sprites are pretty easy.
- Particle effects are really easy.
- IF you used loadGraphic to get an image into your sprite and set the reverse argument to true, THEN you can say "facing = FlxSprite.LEFT" to change the direction of your sprite at your discretion.
- You can draw things (sprites, shapes) or a trail of things to the screen by making a big, transparent sprite the size of your game and then saying hugeSprite.draw(testSprite,x,y),  permanently rubber-stamping the smaller sprite into the huge sprite.

Sleeping now... more games tomorrow!

Monday, October 18, 2010

Mount Pilchuck Hike Report

I hiked up Mt. Pilchuck with Adam on Saturday (October 16, 2010). This weekend was possibly the last hiking-friendly weekend of the year up here in the Pacific Northwest. Anyway, conquering a mountain totally counts as a project for the purposes of this blog. Especially when the hike is tracked by GPS and the hikers encounter treacherous ice!

The trail:
There is no map at the trailhead, but the 3 mile trail (which ascends over 2,200 feet) looks like this from above:

I had hiked up to Lake Serene a few weeks ago, which is also some 2000+ feet in under 3 miles, and involves a lot of switchbacks and wooden staircases built into the trail. I expected the same of this Pilchuck mountain, but it's not really like that at all. The first mile of the trail is kind of similar: tame, upward-sloping trail, the occasional man-made steps, a little creek to hop over about 5 minutes in. At about one mile, the trail has a switchback through a bunch of boulders. The second mile is a little rockier. After about two miles, there is a lovely panoramic vista to the north, and then the trail really starts scrambling up the mountain.

The treachery:
At this point, maybe 2 miles in, I had to put my camera away so it wouldn't get crushed between myself and a rock if I slipped and fell. The trail was basically all rock at this point, which would have been okay, except that it was icy rock. Many places you'd normally want to plant your feet on the granite were too slippery. Mud from other people's boots froze on the popular stepping locations so you had think hard about where to step and aim for gravely crevasses. The iciness was probably a consequence of doing this hike mid-October.

This photo may give you a good idea of all the rocks, if not the ice. The trail manages to transport hikers from this vantage point all the way to the top of that there mountain.

distant summit

The summit:
Towards the top of the mountain, the trail came around to the sunnier South side and stopped being icy. At the top of the mountain is a nifty lookout hut with history information inside and a sweet wraparound balcony. It's not just on top of the mountain, it's on top of a crazy pile of boulders on top of the mountain. The most scrambling of the whole trip happens here to get up the boulders and then up a ladder to the lookout. It's very cool.

top of the moutain hut

Driving directions:
This hike is accessible from the Mountain Loop Highway, near Granite Falls, WA. It is a little bit past the entrance to Mt. Baker National Forest. I read on the internet (and can now confirm) that the Mt. Pilchuck access road is the right turn directly after the silver+blue truss bridge. The access road is about 7 miles long and kind of gravely. There's a parking lot at the end that requires a Northwest Forest Parking Permit.

Some handy GPS coordinates of the turnoff so you can get driving directions:
48.085808,-121.760623 (turnoff from mountain loop highway)
48.071677,-121.812766 (approximate location of parking lot trailhead)

Hiking time:
Somewhere the internet said the hike took 3.5 hours round trip. It took me 5 hours. While I consider myself a fit 20-something, I do hike kind of slowly, especially on rocky, icy terrain. I also stop frequently to take pictures.

In conclusion:
Do this hike! I recommend waiting for a dry, warmish day... and maybe bringing your hiking poles. It's fun and challenging, the summit lookout shack is neat, and the view is amazing. A whole slew of photos from my trip can be found here on Flickr.

Wednesday, October 13, 2010

Maintaining PHP Sessions Across Multiple Machines

As you may know if you've ever tried to play PhotoCity, the website likes to randomly log you out and make you log back in again before uploading more photos or checking on your progress. The reason is that there are multiple machines in a round robin hosting the website, the website uses sessions, and when a different machine picks up your request, it doesn't know about the session that says you were logged in that the first machine was using.

How to keep sessions alive and consistent across multiple machines?? Some people told me a load balancer was the answer, but since I don't actually maintain the machines myself, that wasn't an option for me.

Yesterday afternoon, I had a list of 4 potential things to work on. Vanquishing this obnoxious sessions problem was one of them. True story: I flipped a 4-sided coin/generated a random number in python, got a 3, and set to work investigating cookies vs. sessions and possible solutions. What I learned:

This is the main website I read:

Lesson 1: Cookies are cool and all (and look easy to use) and are stored locally, but they are too easy to tinker with. I could have stored a player's ID in a cookie and then checked which player was logged in, but the player could have changed a field in the cookie file to be someone else's player ID and then logged in as someone else.

Lesson 2: You can write some magic code and make a new table in your database and then trick the PHP session handler to save its data to a centralized database. I believe sessions also use really small cookies, so basically there is a cookie on the user's computer that tells the database what session ID to look up. The session ID is complicated and hard to guess. E.g. "gm6uf16d20k3vt6kjq790q9fp0". Yeah!

The first step is to make a new table in your own database.

The next step is to write your own session handler/steal this one that I just stole from someone else. Included is a php file that uses the new session handler.
link: magical_session_handler.php (.txt file)
link: hello.php (.txt file)
(I basically borrowed the code from this page, but that one had a bug or two)

You can play with the actual webpage here and watch sessions be preserved:
Without the special session handler, that page is just really simple example of sessions.

Lesson 3: THERE IS A BUG!
The super-easy answer:
By calling session_set_save_handler() again after session_destroy() it will work.

Lesson 4: If you want to display the name of the machine currently serving up your webpage (which one in your round robin, for debugging/curiosity purposes) you can write in PHP:

echo exec("hostname");

The PHP variable $_SERVER did not have quite enough information for me. However, 'hostname' is a standard unix command so you're just getting PHP to run it for you.

I haven't transferred this play example to PhotoCity yet, but I will very soon.

Monday, October 4, 2010

Android Dev Notes

I forgot where all the android dev stuff lived because it's been about 6 or 7 months since I used it. So, some notes to myself about what/where things are.

Eclipse - Yeah.
ADT - Android Development Tools plugin for Eclipse.
Accessible from within Eclipse, under Preferences.
SDK and AVD Manager - AVD = Android Virtual Devices.
Accessible from within Eclipse, under Window->SDK and AVD Manager, or by running 'android' from my terminal.
Emulator - Good ol' fake phone.
Start one from the AVD Manager. I think I can close the AVD manager after I've started up a fake phone. Yes.
ADT eclipse plugin preference page
Android SDK and AVD manager!

Also, applications with maps work better once an api key has been obtained ( AND, for some silly reason, the 'custom debug keystore' in android build preferences filled in/set to the same thing as the default debug keystore. I had been getting this error in logcat over and over again, "MapActivity Couldn't get connection factory client", until I did those 2 things.

Saturday, September 25, 2010

Inform7 Interactive Fiction

I made this interactive fiction project almost a month ago, but I wanted to post about it before I forgot entirely. It was written in Inform7 and it starts off like this:
"Birthday" by Kathleen Tuite
A top hat is worn.
I wanted to make a game for Adam's birthday. One without any art assets. The thought of having to design and build a game, and draw stuff for it, was kind of overwhelming, especially given that I didn't start until after his birthday and kind of wanted to finish within a day or two.

Once upon a time, Adam took this computer science class at UC Santa Cruz: Interactive Storytelling. I wasn't in the class, but I saw him write a crazy text adventure (Play it here! Troy) using something called Inform7. It might be cool to learn!, I thought, so I did.

What is Inform7? It is a free program that lets you compose interactive fiction/text adventures by writing English. Just a whole long list of natural language sentences describing the world or actions in the world. (The sentences don't even have to be organized particularly well... my story starts of rambling about cats and top hats before it even gets into describing the room layout of the world.) Then you hit 'play' and you get a cool little text-based world where you can walk around, interact with things, explore, solve mysteries, etc.

Screenshot of Inform7

The great thing about making a game this way is that you get all this rich, descriptive power for the low cost of writing out a few sentences. This book, written very recently by someone at UCSC, has a more descriptive and awe-inspiring chapter on the descriptive power of interactive fiction. I am no great IF artist (yet?) but here's how I described my couch:

A couch is an enterable supporter in the Living Room. "There is a couch in here, which looks perfectly sittable."

The description is "The couch is dark green leather with a few cat hairs stuck to it."

After entering the couch: say "The couch cusions give way with a little floof and you make yourself comfortable.".

I also added some cats to my game, because Inform7 already knows about things like people and animals:
A cat is a kind of animal.
A cat is either playful, hungry, bored, sleepy or sneezy.

To make the cats more catlike, I found a feline-behavior rulebook in the documentation and adapted it to fit the behavior of my own cats and to try to get them to follow the player around between different rooms.

The end result in my case, which took me about a day and a half to put together, including the time it took to learn Inform7, is playable here: (Bonus, there's a 'for release' sentence you can add that spits out a pretty webpage for your game!)

Click here to check it out online!

The goal of the game is to find and eat the birthday cake. The catch is that you have to be in the presence of cats (have them in the same room with you) to enjoy the cake, so you have to find the cats also and have them follow you to the location of the cake. Play it and let me know what you think! I know it's not perfect and there are was to do unrealistic things or get stuck. Feel free to cheat by reading the source code.

Tuesday, September 21, 2010


This post is dedicated to the 10-years-younger version of myself when I was trying to put a photo album on my website and didn't have an efficient way to resize all my images and make thumbnails. I think I opened them all up in photoshop and developed a fairly quick and repeatable sequence of clicks and key presses to manually resize each image. Basically, I'd go into mechanical robot mode, even though I was using a computer capable of automating all that for me.

These days, if you search 'batch image resize', you'll find a bunch of pointy-clicky software that will do the job. But I'm going to talk about the command line approach, since most of those programs are just awkward GUIs wrapped around this library anyway.

Behold: ImageMagick! (
Perfect for the teen with the website photo album, perfect for the grad student who deals with a ton of images and photos.

First: Get it installed. This part is probably the trickiest, and other places on the internet can tell you how it's done. Essentially, you can download an installer for any operating system, though you might have to figure out how to change a 'path' or two so your computer knows where to find imagemagick. I believe imagemagick is sexiest when used on linux or mac. I might have tried to get it through cygwin back in my windows days. If you get it through cygwin, you can just check the cygwin install box that says you want imagemagick included. Once it's installed, it's not a program that you launch so much as a COMMAND LINE TOOL that you run with a few sensible arguments that super-easily gets what you want done.

Try typing 'convert'.

You don't actually type or run imagemagick anymore, that's just what's responsible for making the 'convert' command available. If it spews a bunch of text about which version, how to use, etc, that's great! That's the documentation that you can look through later to find all the magical things that imagemagick is actually capable of.

Now for some examples of what I often use the 'convert' command for:

Resizing a single image:
convert -resize 200 boycat.jpg small_boycat.jpg
(this makes the new image 200 pixels wide.)

convert -resize x200 boycat.jpg taller_boycat.jpg
(notice the x before the 200. this makes the new image 200 pixels TALL instead.)

Here's an image of the 3 different sizes of the photo of my cat!

Resizing multiple images:
I have 3 images now of my cats. I want to make thumbnails of each of them. I COULD type out:
convert -resize 200 boycat.jpg small_boycat.jpg
convert -resize 200 boycat2.jpg small_boycat2.jpg
convert -resize 200 girlcat.jpg small_girlcat.jpg

OR I could type this magical bash for-loop:
for i in *.jpg; do convert -resize 200 $i small_$i; done

You can see that there are now 2 versions of each image and that the "small_" ones are much smaller in filesize!

Converting between image types:
This is so ridiculously easy. You want to make one of your .jpg photos into a .png?
convert small_boycat.jpg small_boycat.png

Combining several images into a single image:
Sometimes I need to stick a few images together for whatever reason.
There are 6 images in my folder of cat images right now (3 original-sized and 3 smaller ones from the multiple resize command), and I only want to use the 3 small ones. To do so, I use this command:
convert -append small_*.jpg catstrip.jpg

That makes the image form a tall column, like from a photo booth. It turns out that to make a horizontal montage, change -append to +append!
convert +append small_*.jpg catstrip2.jpg

There! Cute cats and some useful image-manipulation tidbits. Find out all the other cool stuff you can do with 'convert' here:

Friday, September 10, 2010

PhotoCity Summer

PhotoCity doesn't have its own blog, but I do! (As of very recently...) So let me tell you all about what happened with the game this summer.

The epic competition between University of Washington and Cornell that brought in over 100,000 photos (wow!!) wrapped up in late May. From then until mid-June was a mad rush to get everything ready for the Foundations of Digital Games conference, followed immediately by taking PhotoCity the Smithsonian Folklife Festival.

Here's a shot of the Arts Quad at Cornell reconstructed by PhotoCity players:

(see full size)

We presented on PhotoCity at FDG. You can find the paper, presentation, videos, etc. on my home page: The paper discusses the design challenges of designing a hybrid alternate reality game with a purpose (or "ARGWAP"). In other words, a GWAP played out in meatspace. This was the first thing we ever published on PhotoCity, and my first conference talk! And oh boy, what an exciting talk! Conference attendees may remember it as being in the session where the projector was totally busted and we had to give our talks with 50% of our slides missing. I still think I gave a pretty good talk, though.

During the conference, I took some photos around Asilomar Conference Center, and added them to the game. The textured wood and cloudy skies made the seeds look really nice.

Also, there was a tiny pony:
FDG pony

This photo would probably fit into the 3D model. A 3D pony would not magically appear, though. Maybe he's textured enough, but he's in a different position in the other photos I have of him.

Smithsonian Folklife Festival
Right after FDG, I flew from California out to DC. The guys from the Smithsonian 3D digitization team contacted us and proposed having attendees of the Foklife Festival, the annual 2 week, million-people multi-cultural festival, play PhotoCity and reconstruct the Smithsonian buildings all around the National Mall.

Visiting DC was really cool. Having a presence at Folklife was cool. We had a booth with a computer set up and we'd show people the models and tell them that they could contribute just by taking photos with their own cameras.

photocity booth

Some people played. Some people submitted a few hundred photos each. One person submitted over 1,000 photos! The problem was that people at Folklife (the visitors) didn't really understand the game. "Me? My camera? You mean I have to remember to upload my photos when I get home? Whaaaat?" The lesson: In it's current incarnation at least, PhotoCity totally fails as a casual game. It's too involved, too complex, also too awesome for mere mortals to comprehend.

The rest of the summer
Nothing really happened with PhotoCity the rest of the summer. I took a hiatus, and therefore the game took a hiatus. I went to a workshop on Human Computation and talked to some people about PhotoCity and their own crowd sourcing methods. I traveled and took photos in exotic places. (Like Massachusetts... and Barcelona...) If only the game worked well enough for me to upload my photos!

Right now, I am working on a second PhotoCity paper.

It is also important to me to fix up PhotoCity so that it's stable and usable and fun again. The main things I want to fix are:
- making it super easy (and fast) for anyone to add seeds anywhere
- figuring out a better solution to the problem of occasionally running out of disk space
- reprocess the models that are sort of gnarly (sometimes when a model grows, it gets kind of unruly and extra walls or other weird growths appear)

So, Internet, I am open to suggestions about the most important things to improve about PhotoCity!