<img src="/images/tutorial/little_sphere.png" style="float:left; margin-right:10px;" />
<h1>Converting Large Panoramic Images to PhotoOverlays<br/> for Google Earth with 360 Cities</h1>

<p>
	by <a target="_blank" href="http://vision.bc.edu/~dmartin">David Martin</a>, <a href="http://www.360cities.net/profile/jeffrey-martin">Jeffrey Martin</a>, and the <a target="_blank" href="http://www.360cities.net">360 Cities</a> Team
</p>

<h2>Outline</h2>

<ul>
	<li><a href="#intro">Introduction</a></li>
	<li><a href="#what">What is a Panoramic Image?</a></li>
	<li><a href="#create">Creating a Panoramic Image</a></li>
	<li><a href="#publish">Publishing a Panoramic Image on 360 Cities</a></li>
	<li><a href="#multires">Multiresolution Tiled Image Pyramids</a></li>
	<li><a href="#view">Viewing Large Panoramic Images</a></li>
	<ul>
		<li><a href="#view_ge">Showing Tiled Panoramic Images in Google Earth</a></li>
		<li><a href="#view_krpano">Showing Tiled Panoramic Images in Krpano</a></li>
	</ul>
	<li><a href="#conclusion">Conclusion</a></li>
	<li><a href="#links">Links to More Information</a></li>
</ul>

<h2><a name="intro">Introduction</a></h2>

<p>
	You are probably already familiar with medium of 360 degree panoramic images from 
	either Google Street View or <a target="_blank" href="http://code.google.com/apis/kml/documentation/kmlreference.html">KML</a> <a target="_blank" href="http://code.google.com/apis/kml/documentation/photos.html">PhotoOverlays</a> in <a target="_blank" href="http://earth.google.com/">Google Earth</a> (from the <a target="_blank" href="http://www.gigapxl.org/">Gigapxl</a>, <a target="_blank" href="http://gigapan.org/">Gigapan</a>, or <a target="_blank" href="http://www.360cities.net">360 Cities</a> layers).  Tools for authoring panoramic images
	are getting very good, but the process of preparing and presenting such images on the web is still difficult.
	That is part of the motivation behind the creation of 360cities.net: panoramic photographers use our site to replace the otherwise difficult and time-consuming process of publishing their geotagged panoramas to the web. 
</p>
<p>
	 You can
	turn on the 360 Cities gallery layer in Google Earth to view panoramas from our system.  The screenshots below
	show how these panoramas appear in Google Earth.  From top left to bottom right, these images show (1) the
	360 Cities icons marking the locations of panoramas; (2) the info window that opens when you click on one of
	those icons; (3) the floating sphere that appears when you get close to one of the images, and (4) the view
	from inside the spherical image.
	In this article we will demonstrate our technique of creating these spherical 
	panoramic PhotoOverlays for Google Earth.
</p>

<p style="text-align:center;margin:2em 0 2em 0;">
	<a target="_blank" href="/images/tutorial/ge-screenshots/full/1.jpg"><img src="/images/tutorial/ge-screenshots/300/1.jpg" title="Google Earth Screenshot #1 (click to enlarge)" /></a>
	<a target="_blank" href="/images/tutorial/ge-screenshots/full/2.jpg"><img src="/images/tutorial/ge-screenshots/300/2.jpg" title="Google Earth Screenshot #2 (click to enlarge)" /></a>
	<br/>
	<a target="_blank" href="/images/tutorial/ge-screenshots/full/3.jpg"><img src="/images/tutorial/ge-screenshots/300/3.jpg" title="Google Earth Screenshot #3 (click to enlarge)" /></a>
	<a target="_blank" href="/images/tutorial/ge-screenshots/full/4.jpg"><img src="/images/tutorial/ge-screenshots/300/4.jpg" title="Google Earth Screenshot #4 (click to enlarge)" /></a>
	<br/>
	Google Earth Screenshots (click to view larger images)
</p>

<h2><a name="what">What is a Panoramic Image?</a></h2>

<p>
	A panoramic image is the ultimate wide angle image.  A normal photo shows you what the world looks like in an instant in time from a single
	viewpoint over some limited field of view.  The widest wide angle lens, a fisheye lens, can show you up to a 180 degree field of view, which covers half
	the viewing sphere.  A panoramic image, on the other hand, <em>covers the entire viewing sphere</em>, so that you can look in any direction.  A panoramic image is not
	a 3D image:  It is still a single viewpoint image, but its field of view is not limited.
</p>

<p>
	Because a panoramic image shows you what the world looks like from a single viewpoint, it is shaped like a sphere.  Computers aren't so good
	at representing spheres, however, so panoramic images are stored as regular rectangular images.  One could use any cartographic mapping to
	unwrap the sphere onto a rectangle.  The most common representation used for panoramic images is the <a target="_blank" href="http://mathworld.wolfram.com/EquirectangularProjection.html">equirectangular projection</a>, which
	looks like this:
</p>

<p style="text-align:center;margin-top:2em;">
	<a target="_blank" href="http://360cities.net/image/birth-of-benjamin-martin"><img src="http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/equirect/4.jpg" title="Click to explore this image at 360cities.net" /></a><br/>
	<a target="_blank" href="http://360cities.net/image/birth-of-benjamin-martin">The Birth of Benjamin Martin</a> by <a target="_blank" href="http://360cities.net/profile/jeffrey-martin">Jeffrey Martin</a>
</p>

<p style="text-align:center;margin-bottom:2em;">
	<a target="_blank" href="http://360cities.net/image/old-town-square-christmas-market"><img src="http://360cities.s3.amazonaws.com/pano/jeffrey-martin/old-town-square-christmas-2007_staromak-christmas-2007/equirect/4.jpg" title="Click to explore this image at 360cities.net" /></a><br/>
	<a target="_blank" href="http://360cities.net/image/old-town-square-christmas-market">Old Town Square Christmas Market</a> by <a target="_blank" href="http://360cities.net/profile/jeffrey-martin">Jeffrey Martin</a>
</p>

<p>
	In an equirectangular projection, the equator and all lines of longitude are undistorted.  You can picture the projection as follows: Prick
	a hole in the north and south poles of the sphere, and cut the date line.  Now unwrap the sphere onto a flat surface by stretching at the poles
	without stretching the lines of longitude
	so that the image forms a rectangle.  In an equirectangular projection, the lines of longitude and latitude form a grid of equal sized squares.
	The equator is the central horizontal line; the north pole is all along the top, and the south pole all along the bottom. Distortion is minimal
	at the equator, and infinite at the poles.  The aspect ratio of an equirectangular image is 2:1, because the equator is twice the length of
	each line of longitude.
</p>

<p>
	One does not typically view the equirectangular image, or "equirect", directly
	because of the severe distortions in the polar regions.  The equirect is simply a means of storing
	the underlying spherical image.  Special software can render an equirectangular image into an immersive panoramic experience.  Click on the
	image above to view it in the 360 Cities system.  Make sure to click and drag on the image at 360 Cities to pan; shift and control keys zoom
	in and out.
</p>

<h2><a name="create">Creating a Panoramic Image</a></h2>

<p>
	To create a high quality spherical panoramic image, you need some special photographic equipment and some special software.  Typical photographic
	equipment includes a digital SLR, a fisheye lens such as the Sigma 8mm F3.5 EX DG or the Peleng 8mm f3.5, 
	a tripod, and a <a target="_blank" href="http://wiki.panotools.org/Heads">panoramic tripod head</a>.  
	Because no lens can capture the
	entire image sphere in one shot, one needs to cover the sphere with several shots.  The special tripod head helps to rotate the camera
	without changing the viewpoint.  If the lens nodal point moves between shots, then 
	<a target="_blank" href="http://en.wikipedia.org/wiki/Parallax">parallax</a> will make the next step very hard.  With
	a fisheye lens, one covers the sphere with 2-6 shots, depending on the equipment, circumstances, and desired quality.
</p>

<p>
	The next step is to combine the individual images into a spherical panoramic image in equirectangular
	format.  The process of doing this is far beyond the scope of this article.  There is a good free and open source tool called
	<a target="_blank" href="http://hugin.sourceforge.net">Hugin</a> that many photographers use for this purpose.  There are also commercial programs
	available.  The process is currently semi-automatic, becoming more automatic as time goes on.
</p>

<h2><a name="publish">Publishing a Panoramic Image on 360 Cities</a></h2>

<p>
	Once you have created a panoramic image in the 2:1 aspect equirectangular format, it is a simple matter to publish it on
	the 360 Cities platform, which will make the image available not only on the web but on Google Earth as well.
</p>

<p>
	Once you have <a target="_blank" href="http://360cities.net/account/join">joined</a> 360 cities, 
	you can optionally <a target="_blank" href="http://360cities.net/account">edit your profile</a> and immediately 
	<a target="_blank" href="http://360cities.net/account/new/image">upload your image</a>.  We recommend a minimum
	resolution of 5000x2500 pixels.  You can upload any size, but the practical maximum resolution is currently
	16384x8192 pixels.
	The image will then appear in your <a target="_blank" href="http://360cities.net/account/pending_images/dec/by/updated/page/1">pending images list</a>
	while our system processes it (see below).  When processing is complete, the image will move to your 
	<a target="_blank" href="http://360cities.net/account/unpublished_images/dec/by/updated/page/1">unpublished images list</a>.  Before publishing
	your image, you should edit the image metadata to set at least the title, description, geo location, and heading.
</p>

<p>
	Within a few minutes, your uploaded equirect will be available for viewing on the web and in Google Earth.  During
	those couple minutes, our system converts the image into
	a variety of formats that enable efficient viewing at full resolution on various platforms.  The next section discusses
	these formats.
</p>

<h2><a name="multires">Multiresolution Tiled Image Pyramids</a></h2>

<p>
	Because the full resolution equirectangular images can be quite large (up to 50MB), 
	downloading the equirect to a client for viewing is completely impractical.
	The solution to this problem is to use tiled image formats.  You are probably familiar with the google maps view of the 
	world.  You can think of the google maps webpage as a window into a giant image covering the globe.  How is that image
	represented?  It is cut into small square tiles of a fixed size, typically 256x256 or 512x512 pixels, and only those tiles
	that you are looking at are downloaded.  In this way, once can browse an arbitrarily large image, 
	and the bandwidth requirement on the client is as small as possible -- proportional to the number of pixels in view.  What
	about zooming in and out?  Each zoom level has its own set of tiles.  The entire set of tiles over all zoom levels is called
	a <em>multiresolution tiled image pyramid</em>.
</p>

<p>
	We use this trick to efficiently deliver your high resolution panoramic image to a variety of clients.  The equirectangular
	image that you upload is cut into hundreds or even thousands of tiles; those tiles are streamed to the client on demand, based
	on the client's current viewpoint and zoom level inside the spherical image.
	In fact, we cut the image into two separate multiresolution tile sets in order to support two different kinds of clients.  
</p>

<p>
	Google Earth, through its
	<a target="_blank" href="http://code.google.com/apis/kml/documentation/kmlreference.html#imagepyramid">ImagePyramid</a> mechanism (which is part of
	the <a target="_blank" href="http://code.google.com/apis/kml/documentation/kmlreference.html#photooverlay">PhotoOverlay</a> mechanism), 
	is able to render tiled equirectangular images.
	Because of distortion at the poles,
	however, a tiled equirect is not the optimal tiled format.  
	We use it because we want to support Google Earth, but the amazing flash plugin that
	we use for rendering the panoramic images in web pages -- <a target="_blank" href="http://krpano.com/">krpano</a> -- supports multiresolution tiled 
	cubic images.  A cubic panoramic image is simply a different projection of the sphere into a rectangular image.  In fact, it is a 
	projection of the sphere into 6 square images.  If you place a cube inside a sphere so that the corners of the cube touch the sphere,
	and you project the spherical image onto the faces of the cube, then you get the 6 images of the cubic panoramic format.  For the images
	shown above, the cube face projections look like this:
</p>

<table style="margin:2em 0 2em -34px;">
	<tr>
		<td align="center">Front</td>
		<td align="center">Right</td>
		<td align="center">Back</td>
		<td align="center">Left</td>
		<td align="center">Up</td>
		<td align="center">Down</td>
	</tr>
	<tr>
		<td><img src="http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/front/tile/512/0/0/0.jpg" width="128" height="128" title="Front cube face" /></td>
		<td><img src="http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/right/tile/512/0/0/0.jpg" width="128" height="128" title="Right cube face" /></td>
		<td><img src="http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/back/tile/512/0/0/0.jpg" width="128" height="128" title="Back cube face" /></td>
		<td><img src="http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/left/tile/512/0/0/0.jpg" width="128" height="128" title="Left cube face" /></td>
		<td><img src="http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/up/tile/512/0/0/0.jpg" width="128" height="128" title="Top cube face" /></td>
		<td><img src="http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/down/tile/512/0/0/0.jpg" width="128" height="128" title="Bottom cube face" /></td>
	</tr>
	<tr>
		<td><img src="http://360cities.s3.amazonaws.com/pano/jeffrey-martin/old-town-square-christmas-2007_staromak-christmas-2007/cube/front/tile/512/0/0/0.jpg" width="128" height="128" title="Front cube face" /></td>
		<td><img src="http://360cities.s3.amazonaws.com/pano/jeffrey-martin/old-town-square-christmas-2007_staromak-christmas-2007/cube/right/tile/512/0/0/0.jpg" width="128" height="128" title="Right cube face" /></td>
		<td><img src="http://360cities.s3.amazonaws.com/pano/jeffrey-martin/old-town-square-christmas-2007_staromak-christmas-2007/cube/back/tile/512/0/0/0.jpg" width="128" height="128" title="Back cube face" /></td>
		<td><img src="http://360cities.s3.amazonaws.com/pano/jeffrey-martin/old-town-square-christmas-2007_staromak-christmas-2007/cube/left/tile/512/0/0/0.jpg" width="128" height="128" title="Left cube face" /></td>
		<td><img src="http://360cities.s3.amazonaws.com/pano/jeffrey-martin/old-town-square-christmas-2007_staromak-christmas-2007/cube/up/tile/512/0/0/0.jpg" width="128" height="128" title="Top cube face" /></td>
		<td><img src="http://360cities.s3.amazonaws.com/pano/jeffrey-martin/old-town-square-christmas-2007_staromak-christmas-2007/cube/down/tile/512/0/0/0.jpg" width="128" height="128" title="Bottom cube face" /></td>
	</tr>
	<tr>
		<td align="center">Front</td>
		<td align="center">Right</td>
		<td align="center">Back</td>
		<td align="center">Left</td>
		<td align="center">Up</td>
		<td align="center">Down</td>
	</tr>
</table>

<p>
	You can see that this projection has far less distortion than the equirectangular projection.  It is also more efficient in terms
	of storage space and far more efficient to render (requiring only two texture mapped triangles per tile!).  Its only disadvantage is that
	it is somewhat less convenient to manipulate using image editing tools.  
	As a final representation for rendering, however, it is the best choice.
	After reprojecting the uploaded equirectangular image onto full size cube faces, we build a multiresolution tiled pyramid
	for each cube face, yielding a multiresolution tiled cubic format for the panoramic image.
</p>

<p>
	How many tiles are involved here?  Consider a 10000x5000 pixel equirectangular image.  We use 512x512 pixel tiles:
</p>

<ul>
	<p>
		<li>
			For the equirectangular tiled pyramid, we must first construct a pyramid of equirectangular images for
			different zoom levels.  The smallest image -- the top of the pyramid -- is 1024x512 pixels.  Each subsequent
			pyramid level is twice the width and height of the previous, until we meet or exceed the original image size.  For
			this example, there are 5 equirect pyramid levels: {1024x512, 2048x1024, 4096x2048, 8192x4096, 16384x8192}. Each
			of these images is then cut into 512x512 pixel tiles.  Each level has 4x as many tiles as the previous level.  The
			total number of tiles is 2 + 8 + 32 + 128 + 512 = 682.  In fact, Google Earth needs a single 512x512 pixel tile at the apex
			of the pyramid, so the number of tiles in the multiresolution tiled equirect pyramid is actually 683.
		</li>
	</p>	
	<p>
		<li>
			For the cubic tiled pyramid, the process is essentially the same.  We begin with cube faces of size 512x512 pixels
			at the top of the pyramid.  The pyramid grows until the cube faces are large enough.  In this example, 4096x4096
			cube faces are large enough because 4*4096 &gt; 10000.  The sizes of the cube faces in the pyramid for this example
			are therefore {512x512, 1024x1024, 2048x2048, 4096x4096}.  Each level has 6 cube faces.  The  number of tiles
			at each level is {6, 24, 96, 384}.  Thus, the total number of tiles in the multiresolution tiled cubic pyramid is 510.
		</li>
	</p>
</ul>

<p>
	If one had to create these multiresolution tiled images by hand, one would go mad.  The tiles also take up a lot
	of space, and are, at best, a hassle to deal with.  The 360 cities platform hides this complexity.  You simply upload a single
	equirect image, and we make sure it is converted and tiled as needed to support efficient rendering.
</p>

<p>
	Where do we do the image processing and where do we store all these files?  There are two amazing Amazon services that make it
	relatively painless to build a scalable processing pipeline and storage system.  
	We use <a target="_blank" href="http://aws.amazon.com/ec2/">Amazon EC2</a> for the
	image processing computations, and we store all the images and tiles in <a target="_blank" href="http://aws.amazon.com/s3/">Amazon S3</a>.  Our image
	processing pipeline uses a variety of free or inexpensive tools such as 
	<a target="_blank" href="http://www.sno.phy.queensu.ca/~phil/exiftool/">exiftool</a>,
	<a target="_blank" href="http://wiki.panotools.org/Nona">nona</a>,
	<a target="_blank" href="http://krpano.com/tools/kmaketiles/">kmaketiles</a>, and
	<a target="_blank" href="http://en.wikipedia.org/wiki/Libjpeg">jpegtran</a>.
	You might expect us to use the wonderful <a target="_blank" href="http://www.imagemagick.org">ImageMagick</a> suite, but
	ImageMagick's memory requirements are far too high when processing large images to be of much use to us.
</p>

<h2><a name="view">Viewing Large Panoramic Images</a></h2>

<p>
	Once uploaded and converted, you may view the image both on the web and in Google Earth.  For the images shown above:
</p>

<ul>
	<p>
		<li>
			You can view an image <em>embedded in a webpage using krpano at 360cities.net</em>
			(<a target="_blank" href="http://360cities.net/image/birth-of-benjamin-martin">birth</a> 
			and <a target="_blank" href="http://360cities.net/image/old-town-square-christmas-market">market</a>). 
			Note that krpano has very nice fullscreen mode.  Click and drag on the image to pan; press the shift and control keys to zoom
			in and out.
		</li>
	</p>
	<p>
		<li>
			You can view an image <em>as an PhotoOverlay on Google Earth</em>
			(<a target="_blank" href="http://360cities.net/ge_kml/image/birth-of-benjamin-martin.kml">birth</a> 
			and <a target="_blank" href="http://360cities.net/ge_kml/image/old-town-square-christmas-market.kml">market</a>).  
			You may have to
			double click on the downloaded KML file in order to launch it in Google Earth.)  The Google Earth panoramic image viewer is
			not as slick as krpano, but it does the job.  Click and drag to pan the image; there is also a pan and zoom control in the top right corner.
			If you exit the photo, the overlay is rendered as a floating sphere!  Double-click on the sphere to fly into it.
		</li>
	</p>
</ul>

<p>
	In either format, as you pan around or zoom in and out, you'll see tiles loaded as needed, just as happens in Google Maps.
	Krpano and Google Earth load only the tiles from the multiresolution pyramid that are needed to render the current view.  The
	tiled pyramids provide a representation that makes these resolution-independent viewers possible.
</p>

<p>
	How can you get krpano and Google Earth to show images like this?  If you use the 360 Cities platform, then, of course, you
	don't have to worry yourself about the details.  In the following subsections, we explain how we instruct these viewers to show these images.
</p>

<h3><a name="view_ge">Showing Tiled Panoramic Images in Google Earth</a></h3>

<p>
	The key sections of the KML for the first image above are shown below.  
	These are all elements inside of the <tt>PhotoOverlay</tt> element:
</p>

<blockquote><pre>
&lt;Icon>
  &lt;href>
    http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/equirect/tile/512/$[level]/$[y]/$[x].jpg
  &lt;/href>
&lt;/Icon>
&lt;ViewVolume>
  &lt;leftFov>-180&lt;/leftFov>
  &lt;rightFov>180&lt;/rightFov>
  &lt;bottomFov>-90&lt;/bottomFov>
  &lt;topFov>90&lt;/topFov>
  &lt;near>10&lt;/near>
&lt;/ViewVolume>
&lt;ImagePyramid>
  &lt;tileSize>512&lt;/tileSize>
  &lt;maxWidth>8192&lt;/maxWidth>
  &lt;maxHeight>4096&lt;/maxHeight>
  &lt;gridOrigin>upperLeft&lt;/gridOrigin>
&lt;/ImagePyramid>
&lt;shape>sphere&lt;/shape>
</pre></blockquote>

<p>
	The <tt>shape</tt> value of <tt>sphere</tt> alerts Google Earth that this <tt>PhotoOverlay</tt> is a 
	spherical panoramic image.  
	The <tt>href</tt> element specifies the URL for the tiles in the multiresolution equirectangular tiled pyramid.
	In the URL, the <tt>$[level]</tt> is replaced with the pyramid level number, starting at 0 for the apex of the pyramid;
	the <tt>$[x]</tt> and <tt>$[y]</tt> coordinates identify the tile within the level, starting at (0,0) in the upper left
	corner (as specified by <tt>gridOrigin</tt>).  The other elements should be mostly self-explanatory.  The <tt>ViewVolume</tt>
	element describes how much of the sphere is covered (all of it, in this case), and the <tt>ImagePyramid</tt> element
	describes the pyramid in terms of the tile size and the size of the base level of the pyramid (8192x4096 pixels).  Google 
	Earth calculates the number of pyramid levels from these values.  For more information, see the 
	<a target="_blank" href="http://code.google.com/apis/kml/documentation/kmlreference.html">KML Reference Documentation</a> and the
	<a target="_blank" href="http://code.google.com/apis/kml/documentation/photos.html">PhotoOverlay article</a> in the 
	<a target="_blank" href="http://code.google.com/apis/kml/documentation/topicsinkml.html">KML Developer's Guide</a>.
</p>

<h3><a name="view_krpano">Showing Tiled Panoramic Images in Krpano</a></h3>

<p>
	<a target="_blank" href="http://krpano.com/">Krpano</a> by has quite good 
	<a target="_blank" href="http://krpano.com/docu/">documentation</a> that describes the various ways to 
	use the krpano flash plugin to view panoramic images in web pages.  
	Note the <a target="_blank" href="http://krpano.com/docu/multires/">short note on multiresolution panoramas</a>.  The canonical
	way to direct krpano is through an <a target="_blank" href="http://krpano.com/docu/xml/">XML interface</a>, but there is also a
	<a target="_blank" href="http://krpano.com/docu/js/">javascript interface</a>.  Here we'll show code for the javascript interface.
	The key sections of the javascript that communicate the structure of the multiresolution tiled pyramid are:
</p>

<blockquote><pre>
so.addVariable("image.type","cube");
so.addVariable("image.multires","true");
so.addVariable("image.tilesize","512");
so.addVariable("image.baseindex","0");
so.addVariable("image.level.count","3");
add_array_elem('image.level',{
  'left.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/left/tile/512/0/%25r/%25c.jpg',
  'right.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/right/tile/512/0/%25r/%25c.jpg',
  'front.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/front/tile/512/0/%25r/%25c.jpg',
  'back.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/back/tile/512/0/%25r/%25c.jpg',
  'up.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/up/tile/512/0/%25r/%25c.jpg',
  'down.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/down/tile/512/0/%25r/%25c.jpg',
  'tiledimagewidth':'512', 'tiledimageheight':'512'
});
add_array_elem('image.level',{
  'left.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/left/tile/512/1/%25r/%25c.jpg',
  'right.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/right/tile/512/1/%25r/%25c.jpg',
  'front.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/front/tile/512/1/%25r/%25c.jpg',
  'back.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/back/tile/512/1/%25r/%25c.jpg',
  'up.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/up/tile/512/1/%25r/%25c.jpg',
  'down.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/down/tile/512/1/%25r/%25c.jpg',
  'tiledimagewidth':'1024', 'tiledimageheight':'1024'
});
add_array_elem('image.level',{
  'left.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/left/tile/512/2/%25r/%25c.jpg',
  'right.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/right/tile/512/2/%25r/%25c.jpg',
  'front.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/front/tile/512/2/%25r/%25c.jpg',
  'back.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/back/tile/512/2/%25r/%25c.jpg',
  'up.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/up/tile/512/2/%25r/%25c.jpg',
  'down.url':'http://360cities.s3.amazonaws.com/pano/jeffrey-martin/00000038_pano.jpg/cube/down/tile/512/2/%25r/%25c.jpg',
  'tiledimagewidth':'2048', 'tiledimageheight':'2048'
});
</pre></blockquote>

<p>
	As you can see, we notify krpano that the image is a <tt>multires</tt> <tt>cube</tt> with a <tt>tilesize</tt> of <tt>512</tt> pixels.
	Each level is specified separately, giving the cube face sizes at that level as well as 6 URL patterns for the 6 cube faces.
	Each URL, as in the Google Earth KML example above, specifies the level number as well as row and column variables
	for the location of the tile within the layer.  The coordinates of the tiles in this case start at <tt>0</tt> as specified
	by <tt>baseindex</tt>.
</p>

<h2><a name="conclusion">Conclusion</a></h2>

<p>
	Panoramic images provide a compelling immersive experience that cannot be matched by traditional imagery.  There
	exist good tools for creating and rendering these images, but managing and publishing them yourself is difficult
	and tedious.  360 Cities is a platform that fills that crucial gap in the tool chain.  Not only does 360 Cities make
	embedding high resolution panoramic images on the web a snap, the image may be viewed in Google Earth as well.
	Now you have an excuse to buy that cool fisheye lens...
</p>

<h2><a name="links">Links to More Information</a></h2>

<h3>Getting Started</h3>
<a href="http://help.360cities.net/taking-panoramic-pictures/how-to-get-started">Getting Started Guide</a><br/>

<h3>Creating Panoramic Images</h3>
<a href="http://wiki.panotools.org">PanoTools Wiki</a> - information hub for panoramic photography<br/>
<a href="http://wiki.panotools.org/Panorama_tools">PanoTools</a> - Panorama Tools<br/>
<a href="http://www.ptgui.com">PTgui</a> - GUI for Panorama Tools<br/>
<a href="http://hugin.sourceforge.net">hugin</a> - panorama photo stitcher<br/>
<a href="http://www.autopano.net/">autopano</a> - automatic panorama stitching<br/>
<a href="http://enblend.sourceforge.net/">enblend/enfuse</a> - image blending and HDR fusion tools<br/>
<a href="http://www.johnhpanos.com/tuts.htm">Panorama Tutorials</a> - more links<br/>

<h3>Creating Tiled Pyramids</h3>
<a href="http://www.krpano.com/tools">Krpano Tools</a> - excellent tile cutting and pyramid tools<br/>
<a href="http://www.autopano.net/wiki/GigaTiler">GigaTiler</a> - another tile cutter<br/>
<a href="http://research.microsoft.com/en-us/um/redmond/groups/ivm/HDView/HDPhotoshopPlugin.htm">HD View Photoshop Plugin</a> - another tile cutter<br/>

<h3>Google Earth PhotoOverlays</h3>
<a href="http://code.google.com/apis/kml/documentation/photos.html">PhotoOverlay Tutorial</a><br/>
<a href="http://code.google.com/apis/kml/documentation/topicsinkml.html">KML Developer Guide</a><br/>
<a href="http://code.google.com/apis/kml/documentation/kmlreference.html">KML Reference Documentation</a><br/>