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:
https://library.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.
25 thoughts on “Searching for books by the colour of the cover”
Comments are closed.
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 …
Beautiful! I love this.
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:
https://library.hud.ac.uk/balti/bookcolor.pl?isbn=0545010225
https://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.
https://library.hud.ac.uk/balti/bookcolor.pl?isbn=0545010225&height=40&width=27
https://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.:
https://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
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’…
pitty it ain’t working anymore….
Sorry, Anita — it’s something that was set up 4 years ago for a bit of fun!
Has two children standing in front of a manchin or a fancy house I think the whole cover has a bluish tent to it. I also think think the children look a little dirty and maybe the boy is holding a teddy and I know is shorter than the girl. Its not scary or about forighn places. the kids are of a white race.
PLEASE PLEASE PLEASE! I NEED TO KNOW WHAT THIS BOOK IS!
I dont have E-mail please type book on this website. Is this website still even used? Or do you not want to help? PLease find the book!
Hi Jennifer
Sorry, this is a 4 year old blog post and I don’t think you’ll get an answer from anyone.
Thanks Dave.
I thought it wasnt used any more.
Do you know of anything else I can use?