"Self-plagiarism is style"

Searching for books by the colour of the cover

31st January 2007

Searching for books by the colour of the cover

posted in misc |

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

colourcover

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.

There are currently 18 responses to “Searching for books by the colour of the cover”

Why not let us know what you think by adding your own comment! Your opinion is as valid as anyone elses, so come on... let us know what you think.

  1. 1 On February 1st, 2007, Paul Stainthorp said:

    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 …

  2. 2 On February 1st, 2007, Michael Stephens = Norman Bates?!? » "Self-plagiarism is style" said:

    [...] 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 [...]

  3. 3 On February 7th, 2007, Flamingo House Happenings » More books by color said:

    [...] and choose books based on the color of their covers? Hell yea it would be. Check out good ole webcat! [...]

  4. 4 On February 7th, 2007, Denise said:

    Beautiful! I love this.

  5. 5 On April 19th, 2007, OPAC Survey results - part 8 » "Self-plagiarism is style" said:

    [...] respondent wanted to be able to search by colour of cover and another wanted wiki style functionality adding to the [...]

  6. 6 On April 21st, 2007, Edward Vielmetti said:

    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).

  7. 7 On April 21st, 2007, Dave Pattern said:

    Ed — I'm not aware of one, but give me an hour and I'll see what I can come up with! :-)

  8. 8 On April 21st, 2007, Dave Pattern said:

    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!

  9. 9 On April 22nd, 2007, Edward Vielmetti said:

    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.

  10. 10 On April 22nd, 2007, Dave Pattern said:

    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

  11. 11 On April 24th, 2007, Edward Vielmetti said:

    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.

  12. 12 On May 21st, 2007, phrebh said:

    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.

  13. 13 On May 21st, 2007, Dave Pattern said:

    heh heh — as Marguerite Duras once said, "The best way to fill time is to waste it."

  14. 14 On July 9th, 2007, Venus Goody said:

    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

  15. 15 On July 9th, 2007, Dave Pattern said:

    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

  16. 16 On September 28th, 2007, Searching for books by their color . . . « Turning Pages - The USCA Library Blog said:

    [...] 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: [...]

  17. 17 On November 3rd, 2007, Alex said:

    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'…

  18. 18 On March 11th, 2008, Book covers, revisited » "Self-plagiarism is style" said:

    [...] spotted that Tim is busy working on something that I dabbled with last [...]

Leave a Reply