다음을 통해 공유


Deep Zoom Batch Export (Programmatically using C#)

[UPDATE: You can find an updated version of this library here]

The Deep Zoom composer is a great tool to manually design a composition. It is still in an early stage and I’m sure its team will add lot of interesting new features in the future. lightbulb

Meanwhile…I think that something where it lacks is the possibility to perform a proper batch export, given a lot of images.

SCENARIO: your want to show 500 pictures using DeepZoom. Due to the high number of pictures, you decide to implement a collection and positionate the images at run-time.

Using the batch export feature of the composer, you can only create several single deepzoom composition…and you miss the option to create a collection.

image

Luckily the Deep Zoom application comes with a tool (SparseImageTool.exe) which is installed in the application folder. The tool allow you to create a collection from the command line, giving as parameter the SceneGraph file and the images input folder (plus other interesting parameters).

image

Not too bad...but...what is the SceneGraph.xml file? This file is an xml file containing the layout of our scene, with the following format:

image

We now have all the tools and information to programmaticly create our collection, avoiding the direct use of the UI of the composer. As proof of concept, I created an application to create a Deep Zoom collection using C#, without opening the Deep Zoom Composer UI.

  • The tool take as input the folder containing all the images to convert, the destination folder and the name of the collection. That’s it!!
  • The generated output is a collection where all the images are overlapped in position (0,0) with their original dimension, and the zoom is set to 1. star

image

Source-code of the application is attached at the bottom of this post.

I will move this application to CodePlex as soon as possible, since I believe the community could add more interesting features. Don’t you? smile_wink

PS: Once you exported your collection using this tool, you can start positionating/resizing/… images using C#…I’ll write a new post about this later…

[UPDATE: You can find an updated version of this library here]

Technorati Tags: Deep Zoom,C#

DZBatch.zip

Comments

  • Anonymous
    May 05, 2008
    PingBack from http://www.travel-hilarity.com/airline_travel/?p=4337

  • Anonymous
    May 13, 2008
    hey, i think the argument that is passed to the process is wrong...don't you think the string "args" should be something like this? string args = string.Format(@"CreateCollection ""{0}"" ""{1}"" /XML", SceneGraphFile, Path.Combine(ImagesDestinationFolder, CollectionName + ".sdc")); I have added the /XML just to get an items.xml file as well...

  • Anonymous
    May 13, 2008
    Hi Preethi, you are right...you need the "" if your path has spaces inside... Thanks for the feedback. Expect a new library with more features comgin soon... ;)

  • Anonymous
    May 28, 2008
    Hi Girogio! Great post! Did a Silverlight 2 session at REMIX Sydney and Melbourne, and part of that session was done by Jose Fajardo who talked about making "every" image deep zoomable. This is a nice sample of automating the sparse image tool - Allready shared it with a guy on the Silverlight.net forum. You should get it up on Codeplex so we can start adding features - Like turning it into a windows service that monitors a folder for incomming files and automatically converts them into deep zoom collections :) Cheers, Jonas Follesø

  • Anonymous
    May 28, 2008
    Hey Jonas, how are you doing? I've written an updated version of this library...I will release asap SL Beta2 goes public :) Stay tuned!

  • Anonymous
    June 02, 2008
    Great little tool Giorgio! For those running 64bit vista I needed to point to the "program files (x86)" folder for the sparseimagetool.exe and also put quotes around the locations for the generated xml file and the output folder. eg: C:Program Files (x86)MicrosoftDeep Zoom Composer>SparseImageTool.exe CreateCo llection "C:UsersjohnAppDataLocalGiorgio SardoDZBatch\1.0.0.0SceneGraphF ile.xml" "c:tempBatchCollection.sdc" This is incredibly useful, please keep posting what you are upto with Deep Zoom. I'll make sure to post back what I'm doing with really large collections (18,000+) using your tool with a few modifications ;) The key thing we are doing is linking to a database that describes the images in great detail, but using the z-index as a key and using your tool to put that refenence into the database as we generate the collection we can impliment filtering, sorting, search and metadata.

  • Anonymous
    June 02, 2008
    The comment has been removed

  • Anonymous
    June 02, 2008
    Jonas has already mentioned it but if you are looking for way to automate a batch process for creating

  • Anonymous
    June 02, 2008
    Thank you John, I'll publish a new revisioned library this week :) Any feedback or comment will be appreciated! :D Cheers, G.

  • Anonymous
    June 04, 2008
    Hi gisardo, Great Post. I am searching for it from long time. But I want to use this for web application dynamically generating object. Please suggest me, what to do. Thanks in advance. Rams.

  • Anonymous
    June 06, 2008
    Thank you Rams, with the current release of DeepZoom you need the SparseImageTool in order to generate images. I'm not sure about your scenario, but eventually:

  1. You could install a sort of "service" in the machine containings images, that upload them to the web
  2. If you have administrator rights in the Web Server, you could create a web service that receive images and generate the DeepZoom collection out of them. Today we still have a "preview" version of deepzoom, so expect more features as it goes live :) ciao! Giorgio