My favorite feature of the Flickr photo sharing service is the ability to annotate sections of a photo, like I did with a screenshot of my PC desktop. (Mouse over that picture and you'll see what I mean.) This is very cool, and I don't want you to have to click through to Flickr to see it. I want to be able to annotate my own photos here on Scribbling.net.
So today I endeavored to replicate this functionality using client-side markup. And I got close.
Update: I got it!
So, using a regular ol' HTML image map and the excellent overLIB Javascript library, I was able to map out the following photograph from the marathon yesterday and add notes to specific sections of the picture. You'll notice that unlike Flickr, this technique allows you to annotate circles and polygons as well as rectangular areas of an image. Mouse over the photo below to see what I mean.

Update November 26, 2004: Since I published this article on November 8th, several techniques to display notes on an image have been developed. Here's a list:
- The Daily Kryogenix' DOM Image Annotation
- CSS-only Image annotation
- Frank Manno's CSS Image Maps
- CSS Image Map (this one was actually around long before this post.)
- FotoNotes Phun - Mark's awesome CSS-only implementation.
- That Crazy Photo Thing - Gary Weisserman's implementation which supports photos in the annotation
I've opened up comments again below so if you have something else to add to this list, go ahead and do so below.
Also, thanks to Anil's comment below, I've gotten in touch with the FotoNotes developers, and released code which automatically generates the map above based on FotoNotes data which is stored directly in the image file: FotoNotes RolloverViewer.
Using it, I've incorporated annotated images into my photo gallery. To see it in action, see my Helicopter Tour of New York City photo gallery.
Overlib is really nice, but I think I've already explained that I'll go out of my way not to use Javascript if at all possible. Javascript is icky.
This recent find might be more appropriate for cases where you need to specify *points* of interest/ or just rectangular areas, or maybe for quickie purposes, anyway:
http://www.moryson.net/eintrag.cfm?eid=8
I particularly like the fact that it's totally tweakable in-browser. I don't want to think about trying to define map areas manually without a visual editor.
The page is in German, but the code is pretty self-explanatory if you give it a minute. Bonus: it's (sorta[?]) semantic! *rolls eyes*
I agree with you about Javascript. I kinda feel the same way, except worse, about Flash. Which was why I was taking the Flickr UI and making it Javascript. But I very much like this technique... though I must admit the German is making it a little tough to get my brain around what's happening... ohh, I *think* I get it....
I'm a big fan of the unobtrusive DHTML movement, and admit my distrust of JS stems from the past necessities of huge browser detection scripts, but if I can get acceptable resuls with a little extra stylesheet/markup twiddling, I'd as soon not bother with the scripting at all. Also, users are much less likely to have styles turned off/overriden than Javascript.
http://www.alistapart.com/articles/sprites/
The irregular shapes here remind me of your photograph:
http://www.alistapart.com/d/sprites/ala-blobs2.html
Great suggestion, though, Anil. I'd love to create an open web interface to embedding the metadata, then have a script generate the image map above based on the fotonotes data.
Check out the one I made for San Francisco!
I elected not to include the hover (despite being a key component to your story), because it didn't look very nice. And apart from having the flickr look-and-feel, i'd rather have it just be simple.
Thanks again!
I look forward to adding maps to the other members of the freefi family.
I think a web interface to achieving the client-side display is in order first, *then* the interface to save the metadata to the file ala fotonotes, then a class to read the metadata and render the front end.
Having different tools and approaches to rendering the annotations is *great* to see!
I've been converting Fotonotes.net to a wiki to discuss and evolve the standard. Hopefully, enough pages will be complete the site can go live this weekend!
Height oF DHTML Achieved, Keep Experimenting
I found your side while checking my referers. Nice, that you like my Code on moryson.net.
If someone has problems with the German language, do not hesitate to post a question. Germans donīt bite ;-)
This discussion has been closed. Thanks to everyone who participated. See Scribbling.net's comment policy for more information.