Wednesday, July 13, 2016

Using exiftool to create Facebook 360 panorama images

Facebook has a wonderful feature to show 360 degree panorama photos. Especially when you use mobile device - you can turn around to show all the uploaded panorama.
However, it is a little bit tricky to create an image that will be recognized as panorama by Facebook. Even if you upload an 6000х3000 image - Facebook thinks it is an ordinal photo. To create a Facebook 360 Panorama - you have to add special meta tags to the image.

Using Photoshop

Create the file panorama.xmp with the following text content (assume your image is 6000x3000):

<rdf:Description rdf:about="" xmlns:GPano="http://ns.google.com/photos/1.0/panorama/">
<GPano:CroppedAreaImageHeightPixels>3000</GPano:CroppedAreaImageHeightPixels>
<GPano:CroppedAreaImageWidthPixels>6000</GPano:CroppedAreaImageWidthPixels>
<GPano:FullPanoHeightPixels>3000</GPano:FullPanoHeightPixels>
<GPano:FullPanoWidthPixels>6000</GPano:FullPanoWidthPixels>
</rdf:Description>

In menu "File" - "File Info" import the metadata for your image from panorama.xmp

Using Exiftool (from console or bash script)

Create the panorama.xmp:
<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 9.74'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>

 <rdf:Description rdf:about=''
  xmlns:GPano='http://ns.google.com/photos/1.0/panorama/'>
  <GPano:CroppedAreaImageHeightPixels>1182</GPano:CroppedAreaImageHeightPixels>
  <GPano:CroppedAreaImageWidthPixels>5732</GPano:CroppedAreaImageWidthPixels>
  <GPano:CroppedAreaLeftPixels>2866</GPano:CroppedAreaLeftPixels>
  <GPano:CroppedAreaTopPixels>842</GPano:CroppedAreaTopPixels>
  <GPano:FullPanoHeightPixels>5732</GPano:FullPanoHeightPixels>
  <GPano:FullPanoWidthPixels>11464</GPano:FullPanoWidthPixels>
 </rdf:Description>

</rdf:RDF>
</x:xmpmeta>
<?xpacket end='w'?>

Load meta data to the image file:
exiftool -Tagsfromfile panorama.xmp panorama.jpg

Where panorama.jpg - is the source image file to create panorama.

Have Fun!

1 comment:

  1. Experts employ Flash to accomplish this, enabling viewers to rotate the product and to zoom and pan.

    360 virtual Tour Aurora

    ReplyDelete