« reshelve the entire university library by color | Main | Project for Public Spaces: Why Libraries Matter More Than Ever (Cynthia Nikitin, Josh Jackson) »

23 April 2007


Dave Pattern

I've also added "colorspace=HSB" as an option (Hue/Saturation/Brightness) which I think is the same as "HSV", just in case that turns out to be an easier value to build a rainbow from.

I've had a couple of stabs at creating a rainbow but I've not found the magic formula yet. Sorting by hue works well as a starting point, but there's obviously more to it than that.

One issue is that the average color of the book cover can sometimes seem odd -- for example, if half the book is blue and the other half is red, then the average is purple. Or should that be, if you're feeling blue and you've only read half the book, then it's purple? ;-D

If anyone is looking for a random-ish feed of ISBNs to play with, then you can use this:


Ed Vielmetti

Yeah, I wondered about the kinds of muted colors that are coming out of there.

Should there be some way to pick out the "dominant colors" of a book, something like a histogram or spectrogram and pick out the peaks? That white book with black print is really white, not gray, or maybe it's 90% white, 10% black with a stripe.

Wikipedia turns up this other color space, which might actually work better - it plots things on a 3d space, but if you ignore "lightness" you could go 2d with it and then do your wall of books with a


which bunches things together pretty nicely.

Dave Pattern

I'm using ImageMagick, so I'm limited to the colorspaces that it supports:


Another option would be to use the "height" and "width" parameters to fetch back more pixel averages.

If you pull back a 3x3 (which gives you 9 hex values), that white book with black print should give you more more values that are closer to white.

For example, if you take a look at this book cover:


Then the average color is a greyish green:


If you bring back the 3x3 data, then you get more of a flavor of the cover:


With a 6x6, then you can see that most of the cover is whiteish:


Dave Pattern

Still not quite there, but I've been playing with looking at the mean value(s) compared to the average color.

This page fetches a random book cover and displays the average color, along with some of the mean values:

First of all it resamples the images to 30x30 pixels and then looks at the general colour of each of the 900 pixels. If there are any colors which appear in more than 5% of the pixels, then those are listed.

If you want to see a specific book, then include the ISBN in the URL, e.g.

I'm not sure if this really helps us get that rainbow, but it's kinda fun just playing around!

Edward Vielmetti

Note Dave's pointer to recent work here:


and the Colourphon service under development


The comments to this entry are closed.

About Superpatron

  • Superpatron

    For library patrons who love their libraries, who take advantage of everything they have to offer, and are always on the lookout for great ideas from libraries around the world. From Edward Vielmetti, [email protected] .

    Follow me on Mastodon as @[email protected]