[Tutorial] How to edit 360° Photos without distortion using GIMP and Blender

tutorial

(David V) #1

The problem
Let’s say we have a 360° Photo (This one was taken from HDRI haven, CC0 by Greeg Zaal)

Now, Let’s say we want to add some big red hearts to the photo and replace the “Hamburg Hbf” with something else. Let me quickly do that using GIMP:

You already see the problem - there is no way you can easily manipulate equirectangular photos.

Damn - Everything is distorted, the hearts stretch and nothing is how it should be!

The solution

Well, Photoshop CC introduced some neat features that let you edit 360 photos more easily. But it is photoshop, that’s not what we want here! So I found a way to do the same using free Software

Now, the real solution

All you need for this is GIMP (or any other image editing program) and Blender.

  • Open Blender
  • Delete everything
  • Switch to Cycles Renderer
  • Take your photo as an environment texture

  • Add a camera (Shift A -> Camera)
  • Rotate it to x=90°, y=0°, z=0°
  • Change the render size to your Panoramas resolution

  • Make your camera a 360° camera in the camera tab
  • You can render the scene now to test if it works properly

  • Now, Add another camera and an empty perpendicular to it
  • Parent the empty to your camera (select the empty first, then the camera)
  • You can test if the empty is properly parented by rotating the camera (hit r twice to rotate freely)
  • Set your new camera as the active one in the scene tab

  • Rotate that camera to the area you desire to edit. You can change the focal length as well
  • Render the picture and save it

  • Now you can open your photo in whatever program you like (GIMP in my case) and add anything you want.
  • Export the image

  • Back in Blender, enable the "import images as planes add-on.
  • Set the cursor to your empty by selecting the empty, hitting Shift+S -> Cursor to Selected
  • Import your edited image (Shift+A -> Mesh -> images as planes)
  • Use a shadeless material, set the offset to 0 and set the plane dimensions to “Camera”
  • Hit “import images as planes”
  • You can set your view to “rendered” to see the result

  • You can repeat that process as much as you like, and also add any image to your scene.
  • As you are using a fully-fledged 3D suite, you can add all sorts of 3D objects to your scene as well!

  • Finally, switch to your 360° camera in the scene tab and render your new 360° image.

And voilá, the text and the hearts bend with the equirectangular distortion:

Of course, this kind of workflow is not as fast and intuitive as it is in Photoshop. However, it is much more powerful, if you consider using all the features Blender has. Maybe, one day there is an add-on to speed that process up. A small tip: if all you need to edit are the top and bottom part of the photo, you can use g’mic to do that


I hope a lot someone here finds this useful :slight_smile: As I’ve never done a tutorial before, I’d love to hear some feedback! Do you know any other methods that are even faster and easier? Thank you all :slight_smile:


(Morgan Hardwood) #2

I look forward to trying this in Blender.

So far I’ve been doing this using Hugin - open the equirectangular image, set its metadata to define that it’s a 360 equirectangular view, find the area of interest using Hugin’s OpenGL viewer, export a rectilinear section, patch it up in GIMP, re-project it back into equirectangular, and merge the two in GIMP.

If you need to quickly reproject the zenith and nadir into rectilinear for fixing, G’MIC has a script for that in “Deformations > Equirectangular to nadir-zenith”, thanks to @David_Tschumperle. I wonder whether it would be possible for it to have a script to re-project any view both ways, not just the zenith/nadir? Or maybe it already does?


(David V) #3

Yes, that feature is pretty cool, I’ve already used it before! And I agree, it would be wonderful if you could reproject the other parts of the photo as well - maybe there is a way to convert equirectangular photos to a cubic projection somehow…


(Morgan Hardwood) #4

Cubic tiles are great for storage, but not so great for editing - you’d either have one tile per layer, which makes editing areas at the edges very difficult, or you’d have the typical cross-shape, which still makes editing edges very difficult but also incurs a huge RAM overhead, wasted on empty space.