1

I have a photo that is 15360x5079 pixels. I want to load it into Marzipano, to make a panorama, but it requires that the file be in 1:2 aspect ratio. So the final height needs to be 7680 pixels.

The thing I'm trying to figure out is how to stretch only part of the image to fill the height. The reason I need to do this is that the 7680 pixels represent 180 degrees of vertical angle and if I stretch the entire image, the horizon line in the photo get's shifted up.

So basically, how can I stretch the top ~1000 pixels of the image to get to the desired height?

  • Are you willing to accept distortion of the image? Stretching an image implies duplication of pixels in one direction while maintaining single pixel dimension in the other direction. If you had a person in the image, he would become much taller and remain slender. – fred_dot_u May 9 at 0:06
  • Yes, previously I've been using MS Paint to just stretch out the top part of the image, distortion is fine, but there's got to be a better way to do it than MS Paint... – kk6axq May 9 at 4:20
0

GIMP's Liquid Rescale plugin could help you. It's basically similar to Photoshop's Content Aware Scaling. It works by using a process called Seam Carving. It also allows you to paint a mask to protect specific areas you don't want to be stretched - particularly useful if there are people or buildings in the shot. The plugin obviously can't work miracles if you have to stretch the image lots.

Here's an example. Original is on the left, image stretched vertically using Liquid Rescale on the right. I didn't need to use a preservation mask on this example. The seam carving algorithm seemed to work quite well. If you experience a problem with your image, you might need to create a preservation mask from the horizon to the bottom of the image.

enter image description here

Creative Commons image - "The Road to Mount Cook along Lake Pukaki" by Trey Ratcliff

0
  1. Open the image as a single layer in Gimp.
  2. Select the part you want to stretch
    • Use the rectangle selection tool R
    • Select. (You can use the dialog to enter exact coordinates)
    • Press Enter
  3. Stretch the selected part
    • Use the scale tool shiftS
    • Stretch the selected part upwards beyond the canvas. (You can use the dialog to enter an exact height. Alternatively, scale it a bit more than necessary. You can crop the image after step 4 using Image > Canvas Size... or the crop tool shiftC)
    • Press Enter
    • Give the newly created floating layer a name.
  4. Use Image > Fit Canvas To Layers to adjust the image size.
  5. Export the image

tutorial animation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.