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

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

hamburg_hbf_4k

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:

https://i.imgur.com/2LbIXxf.mp4

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

https://i.imgur.com/Yqo9jCs.mp4

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

The solution

https://www.youtube.com/watch?v=AL9r6rKwFmI

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

https://i.imgur.com/eZlCNxj.mp4


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

https://i.imgur.com/NwePs9r.mp4


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

https://i.imgur.com/DYM25uF.mp4


  • 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

https://i.imgur.com/g6W4jOJ.mp4


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

https://i.imgur.com/fReFOaF.mp4


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

https://i.imgur.com/n8yBeBp.mp4


  • 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

https://i.imgur.com/e1EMmRd.mp4


  • 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!

https://i.imgur.com/xPMcwrv.mp4


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

final360%20edited

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:

3 Likes

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?

2 Likes

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…

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.

1 Like