{"id":16,"date":"2014-08-21T21:32:52","date_gmt":"2014-08-21T21:32:52","guid":{"rendered":"https:\/\/www.tech.shinynewthings.com\/?p=16"},"modified":"2014-09-08T02:42:55","modified_gmt":"2014-09-08T02:42:55","slug":"batch-process-tifs-with-vips-to-create-deepzoom-microsoft-sea-dragon-openseadragon-image-tiles","status":"publish","type":"post","link":"https:\/\/www.tech.shinynewthings.com\/?p=16","title":{"rendered":"Batch Process Deepzoom \/ MS Sea Dragon \/ OpenSeadragon image Tiles with Bash"},"content":{"rendered":"<p>Zoomable images are awesome.<\/p>\n<p>The people at OpenSeadragon have nailed a javascript implementation of zoomable image tiles. It feels seamless, looks great and is customizable. I got the chance to play with SeaDragon when we created <a title=\"One-Met-Many-Worlds\" href=\"http:\/\/www.metmuseum.org\/one-met-many-worlds\/\" target=\"_blank\">One-Met-Many-Worlds<\/a>. The project was created in part to begin the process of internationalizing our website.\u00a0 For the team working on the project, there were several challenges, because of OpenSeadragon, zoomable images was not one of them.<\/p>\n<p>The process is pretty dead simple.<\/p>\n<p>To start you&#8217;ll need a few things, Homebrew and vips.<\/p>\n<p>Homebrew is a package manager for Mac.<\/p>\n<p>vips is a command line utility that generates tiled images from a tif file.<\/p>\n<p>I installed <a title=\"Homebrew\" href=\"http:\/\/brew.sh\" target=\"_blank\">Homebrew <\/a>from the website.<\/p>\n<p>Installed vips and it&#8217;s dependencies using terminal on a Mac with the following command.<\/p>\n<address>$ <span class=\"c\">brew install vips &#8211;with-cfitsio &#8211;with-fftw &#8211;with-imagemagick &#8211;with-libexif &#8211;with-liboil &#8211;with-libtiff &#8211;with-little-cms &#8211;with-openexr &#8211;with-openslide &#8211;with-pango<\/span><\/address>\n<p>And ran the following command to test tile creation.<\/p>\n<address>$ vips dzsave <span class=\"nv\">filename.tif<\/span> mydz<\/address>\n<p>One down but with over 600 additional tifs to process, I decided it was time to use bash to remove myself from the process and a script was born.<\/p>\n<p><a title=\"BashZoom\" href=\"https:\/\/github.com\/wandertosee\/bashZoom\/\" target=\"_blank\">BashZoom<\/a><\/p>\n<p>It recursively reads a directory structure looking for .tif files. Any tif is tiled and saved into a folder called mydz_files inside the tifs folder. Accompanying this is a small file, mydz.dzi. The xml in this file tells deepzoom the height and width of the image its rendering.<\/p>\n<p>Here&#8217;s a <a title=\"Marble Sarcophagus with the Triumph of Dionysus and the Seasons\" href=\"http:\/\/www.metmuseum.org\/one-met-many-worlds\/eng\/details\/55.11.5\" target=\"_blank\">link<\/a> to one of the works of art, check out the zoom.<\/p>\n<p>To view the zoom itself, use this <a title=\"Zoom\" href=\"http:\/\/resources.metmuseum.org\/resources\/OneMetManyWorlds\/zoom\/?dir=55.11.5&amp;format=mydz.dzi\" target=\"_blank\">link.<\/a><\/p>\n<p>Take a look, use it, fix it, enhance it and\/or drop me a comment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Zoomable images are awesome. The people at OpenSeadragon have nailed a javascript implementation of zoomable image tiles. It feels seamless, looks great and is customizable. I got the chance to play with SeaDragon when we created One-Met-Many-Worlds. The project was created in part to begin the process of internationalizing our website.\u00a0 For the team working [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16"}],"version-history":[{"count":4,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts\/16\/revisions"}],"predecessor-version":[{"id":40,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts\/16\/revisions\/40"}],"wp:attachment":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}