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.


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).


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:


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


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: ,

Comments (16)
  1. Preethi says:


    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…

  2. 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… 😉

  3. follesoe says:

    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 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 🙂


    Jonas Follesø

  4. 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!

  5. SoulSolutions says:

    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\

    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.

  6. SoulSolutions says:

    Oops forgot to say how to fix it 😉

    So if you have the V1 code the only change is to line 118 of DeepZoomBatchHelper.cs:

    string args = string.Format("CreateCollection "{0}" "{1}"",

    Hope this helps,


  7. Jonas has already mentioned it but if you are looking for way to automate a batch process for creating

  8. Thank you John, I’ll publish a new revisioned library this week 🙂

    Any feedback or comment will be appreciated! 😀



  9. ramesh says:

    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.


  10. 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 🙂



  11. Based on the questions I received in the last period, I’d like to share here some links that will eventually

  12. Tian says:

    Nice tool. Any plans to update this for Beta2? Would be neat to get this going with the new XML formats. Have you also seen this project, which doesn’t use the SparseImageTool at all? :


  13. In a previous post I’ve showed how to automate the exporting process of a DeepZoom composition or collection.

Comments are closed.

Skip to main content