« 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

Comments

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:

http://webcat.hud.ac.uk/data/catalogue/covers/recent.txt

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

http://en.wikipedia.org/wiki/L*a*b

which bunches things together pretty nicely.

Dave Pattern

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

http://www.imagemagick.org/script/command-line-options.php#colorspace

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:

http://webcat.hud.ac.uk/covers/bib/365781.jpg

Then the average color is a greyish green:

http://library.hud.ac.uk/balti/bookcolor2.pl?isbn=0672320541

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

http://library.hud.ac.uk/balti/bookcolor2.pl?isbn=0672320541&height=3&width=3

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

http://library.hud.ac.uk/balti/bookcolor2.pl?isbn=0672320541&height=6&width=6

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:

http://161.112.232.18/perl/color2.pl

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.

http://161.112.232.18/perl/color2.pl?0672320541

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:

http://www.daveyp.com/blog/index.php/archives/291

and the Colourphon service under development

http://vielmetti.typepad.com/superpatron/2008/03/colourphon---bo.html

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]