Tonight I added support for Exif data capture from the image (if it is a JPEG). We will need to map this to something useful, but I have already found a schema and a potential description vocabulary.
Try this example.
Tonight I added support for Exif data capture from the image (if it is a JPEG). We will need to map this to something useful, but I have already found a schema and a potential description vocabulary.
Try this example.
We were figuring that it might be useful to have a colour match that was in some way relevancey ranked, so I have been working on ways to achieve this.
What we have now is a result set that is sorted according to the position of the frequent colours in the image. We also know where each cell is in the image, and can calulate – at it’s simplest – a sort order based on centre weighting.
Need an example? These examples will take a moment or two to calculate…
Try this one: Test number one.
Or this one: Test number two.
We divide the image into an odd number of cells, ensuring that there is one in the middle. We then scan each cell and analyse the colour content. Then we give you the results.
Simple yet strangely satisfying, and not only that, but you can analyse an image from any source, be it File, URL or book jacket retrieved by isbn search courtesy of the Talis Platform.
Yeay! Fixed a rather niggly bug.
Displayed colour counts were inaccurate, although the displayed colours were correctly identified as being the most prevalent in the image. This was a frustrating bug, as it meant that calculation of ‘percentage of image of particular colour’ could not be reliably calculated. I mean, I am looking at 36000 odd pixels, and the top colour is reported to have occured 12 times. hmmm.
The bug was mainly caused by an incorrect comparison, which assumed that all colours in the incoming array were repeated sequentially rather than randomly. All I had to do was check for existence of the key, rather than comparing the current value to the previous value. Voila.
So we are pretty happy with the colour guessing now, although at this stage we are limited to a named palette of 254 colours. Try it.
The guessing is based on a sample of the most frequently occurring 400 colours, that are then compared to each other to match those that are within 10%, then de-duplicated at the named colour stage. This seems to give a fairly accurate representation of the main colours in the image. Next stage is capturing that info in some sort of data model. So we are looking into the semantic web’s best friend RDF.