Tool to create and store coordinates for derivative cropped images

366 views
Skip to first unread message

James Morley

unread,
Jul 17, 2015, 3:17:56 PM7/17/15
to iiif-d...@googlegroups.com
Hi

Apologies if this has already been asked (or perhaps answered, with any luck).

I was wondering if anyone has ever developed an interface that allows users to draw rectangles on images and it calculates and displays or even stores the crop parameters. The easy way to explain this is to refer to a tool I wrote many years ago that did the task for Flickr images - see http://catchingtherain.com/flickr/cropr/

But instead of actually creating a derivative file and storing it somewhere, you'd just need to store coordinates. So I could go to e.g. http://gallicalabs.bnf.fr/ark:/12148/btv1b8596922b/f5.item.zoom, draw an rectangle around one of the six portraits, and it would generate coordinates {4470,390,1500,2200} that could then be used in a url like http://gallicalabs.bnf.fr/iiif/ark:/12148/btv1b8596922b/f5/4470,390,1500,2200/full/0/native.jpg

Thanks, James

Drew Winget

unread,
Jul 17, 2015, 3:31:50 PM7/17/15
to iiif-d...@googlegroups.com
Mirador does this, but it isn't very easy to extract for this pared-down purpose. With the right configuration, Mirador can become a cropping tool. It can also export the regions as OA/IIIF annotations. 

I have been meaning to extract this functionality for some time, or otherwise create a callback in Mirador that would allow people to use it easily for this purpose.

For now, however, I think what would make the most sense as a start is to use the osd-canvas-selector module under the IIIF Github organisation. This is the module that is used in Mirador for selecting regions of the canvas for annotation creation. It will allow you to extract regions in IIIF canvas coordinates from an openseadragon canvas in a very specific way (it will not force you to make an annotation, and simply returns the coordinates). Download it from github here.

It is not as fully featured or easy to deploy (from a meta-project standpoint. It is simple to use.) as something like jCrop is for static images, and not documented very much (the example is a pretty complete starting point, however), but I would welcome any contribution to improve it along those lines into something like jCrop. File an issue if you need any help with it, and I or others in the community will do their best to address it and improve the tool in the ways the community needs. I haven't worked on it as a standalone component for some time, so any feedback on updates it may need would be very welcome.

-Drew

--
-- You received this message because you are subscribed to the IIIF-Discuss Google group. To post to this group, send email to iiif-d...@googlegroups.com. To unsubscribe from this group, send email to iiif-discuss...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/iiif-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "IIIF Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iiif-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

James Morley

unread,
Jul 18, 2015, 10:30:49 AM7/18/15
to iiif-d...@googlegroups.com
Thanks Drew

When I get a moment I'll try to take a look and get back to you.

Best, James

John Howard

unread,
Jul 25, 2015, 5:34:23 AM7/25/15
to IIIF Discuss, jamesi...@gmail.com
Hi James,

You might look at the demo tool we've put into place for the UCD Digital Library. The intent is to allow users to work with an image served from the local loris server, select a rectangular region and desired image width, then capture the URL that would return an image with the desired specifications from loris. It's intended to be launched from within Mirador and normally uses local object identifiers to identify images; however it also accepts a uri parameter that demonstrates that the tool could be used with images from other non-local IIIF Image API servers as well.
Best

John

James Morley

unread,
Jul 25, 2015, 10:14:07 AM7/25/15
to John Howard, IIIF Discuss
Hi John

That's excellent - exactly the kind of front end functionality I was thinking of. Just now have to build in the capture of coordinates, but that's maybe where the annotations tool comes in or a pretty simple custom store (though I'd like to avoid that if possible and store them in a standardised, accessible way).

Best, James


---
James Morley
www.jamesmorley.net / @jamesinealing
www.whatsthatpicture.com / @PhotosOfThePast
Reply all
Reply to author
Forward
0 new messages