Iman and Jonathan's comments on my previous post got me wondering how accurate searching by the average colour of a book cover would actually be…
Here's a quick & dirty prototype:
http://webcat.hud.ac.uk/perl/colour.pl
It's so quick & dirty that you'll need to enter a hex value for the colour you want to search for (e.g. FF8C00 or 9370D8) — if you're not that familiar with the hex values, then try this page.
Alternatively, just hit the "pick random colour" button to make something up!
There are currently around 12,000 book covers that it knows the average colour for, but I'll keep adding more once I've finished indexing them.

That is just the single most off-the-wall and simultaneously useful thing I've seen in a long time.
Now, can you cross-index that with subject, so that I can find that book on Perl scripting. You know, the PURPLE one …
[...] on from searching for books by the colour of the cover, it would be just plain rude if I didn't have a stab at ripping off retrievr at the same [...]
[...] and choose books based on the color of their covers? Hell yea it would be. Check out good ole webcat! [...]
Beautiful! I love this.
[...] respondent wanted to be able to search by colour of cover and another wanted wiki style functionality adding to the [...]
Dave – just thinking about this – do you know any web services that you send an ISBN to and you get back the color of the cover? I have an application for that right away (take a snapshot of new books in the library, and sort them by color).
Ed — I'm not aware of one, but give me an hour and I'll see what I can come up with!
Ok — it's definitely beta and potentially cruddy, but here you go:
http://library.hud.ac.uk/balti/bookcolor.pl?isbn=0545010225
http://library.hud.ac.uk/balti/bookcolor2.pl?isbn=0545010225
The first will return an XML response and the second (which is just for fun) displays an HTML page.
You can include optional "height" and "width" parameters (which must be numbers between 1 and 50) and this will return the pixel averages if the cover is resampled to that size – e.g.
http://library.hud.ac.uk/balti/bookcolor.pl?isbn=0545010225&height=40&width=27
http://library.hud.ac.uk/balti/bookcolor2.pl?isbn=0545010225&height=40&width=27
I'm making no promises as to how stable the scripts are and, if they cause any problems on the server, I might have to remove them.
As we Amazon's Web Services, both the XML and HTML outputs contain links to the product page on Amazon (as per the Amazon T&Cs).
Have fun!
OK Dave, I got it working here – wrapped it in a script at
http://www.superpatron.com/wall-of-books/book-color.sh
which you can run as
% book-color.sh 0545010225
A47145
It doesn't do anything more than the minimum, just wraps the interface you have in a script.
The next bit I'm stuck on is more color theory than anything else. How do you sort RGB values into a rainbow? Obviously sorting on the hex code gives you the wrong answer (it sorts by % red), and there's some color calculus to arrange those numbers along a pleasing line, but my initial searches stumped me. I found formulas for "hue" and "luminance" and will try those.
Good question! I did look at this when I was playing around with colours, but couldn't find an easy way of doing it.
I've added an extra parameter to the script so that it will return the HSL value(s) rather than the RGB value(s) — just add the following to any of the URLs:
…&colorspace=HSL
e.g.:
http://library.hud.ac.uk/balti/bookcolor.pl?isbn=0545010225&colorspace=HSL
One more color space to consider:
http://en.wikipedia.org/wiki/L*a*b
which looks like it might shelve the books more nicely – the math to convert from RGB to LAB is a bit tricker but still looks straightforward once you make an assumption or two.
This is great! I mean, the time and effort that must have gone into an essentially useless, although really cool, tool really speaks to my own, vast wastes of time.
heh heh — as Marguerite Duras once said, "The best way to fill time is to waste it."
This is an excellent work.
can I access the catalogued iformation of a particular book from the Amazon's book collection, when I search on its ISBN No.?
Please guide,
Venus
Hi Venus — if you sign up to Amazon Web Services, then you can get details about a specific book as an XML page:
http://www.amazon.com/gp/aws/landing.html
The XML page can include things like: links to a book cover scan; reviews; book suggestions; etc
[...] Christie See this interesting post with a search engine that allows you to find a book by color: http://www.daveyp.com/blog/index.php/archives/170/ Note that you need to know hex values for the colors, you can see those here: [...]
Wonderful idea – I sort my own books like this – I thought it was unusual until I was sitting in the rare books room of a university library next to a distinguished manuscripts scholar. He had ordered a book and it hadn't arrived. He collared the assistant and pointed out that the book was easy to find as it had a red cover. Some time later the book arrived. Without a red cover. Instead of being grateful, the scholar observed, in dissatistisied tones 'I see, you only have the green edition'…
[...] spotted that Tim is busy working on something that I dabbled with last [...]