This is what my bookcase looked like before:
And this is what it looks like now:
So how does a geek organize his books? He uses a technique called self-organizing maps (SOM).
I basically took a high resolution photo of my bookcase (the first picture shown) and then cut out all the book spines and saved them as separate images. After doing that I had 347 little images. I used the ImageMagick command-line tool to resize all these images to a 1×1 picture. I figured that the single pixel in these images would more or less approximate the average spine color. The RGB values of these pixels were then used to train a 1 dimensional SOM. After training, the best-matching unit on the SOM for each bookspine was determined telling me how I should reorder my books.
And yes, I realize that there are easier ways to sort books by color 😉