Hello and welcome back to another video, my name is Mike Davies,
and in today's tutorial I'll be showing you how to
straighten crooked images or crooked horizons using a built-in feature in GIMP. I'll be
using GIMP version 2.10.24 which is the latest version of GIMP at the time of this tutorial.
So thankfully since this feature was introduced in GIMP 2.10.4 this task is really easy. As you
can see here I have a photo opened up in GIMP. The horizon is going to be a little bit crooked here.
The way we straighten this is we'll come over here to the toolbox, and you'll see
a tool called the "Measure" tool. You can either click on it right here in the toolbox or you can
use shift+m on your keyboard. So that's going to open up the measure tool, and down here you'll
see the tool options. I recommend keeping this set to "Auto," however you also have options for
"horizontal" and "vertical" orientation if you know you're going to be straightening something
that's vertical rather than horizontal. And then below that you have the straighten section here,
and you have transform modes. So you can straighten just your current layer,
which in this case we only have a single layer, or you can actually straighten a selection area,
a path, or the entire image. So that would include all layers on here if we
had multiple layers. And then below that you have "Interpolation." So this is performing
a transformation which means that this will lose some quality once the transformation is complete.
It's basically using the rotate tool. So the interpolation allows you to choose the quality,
and cubic is going to be pretty low quality but it'll be faster, whereas NoHalo and LoHalo will
be slower but they will be better quality. I have an entire tutorial dedicated to how to
scale images with minimal quality loss - I do cover interpolation methods and what they mean
in detail in that tutorial, so definitely check that out. I'll just go with NoHalo here for now.
And the clipping option here is for how GIMP is going to handle the new layer that's created.
So because we're using the straighten feature and this is rotating, the corners are basically going
to come up to here, for example if we rotate to the right, and so the clipping option determines
how you handle the new location of those corners. So if I come down here you'll see we
have "adjust," "clip," "crop to result," and "crop with aspect." So adjust is just going to enlarge
the layer size so that it fits the new location of the pixels, the clip option is going to keep the
original layer boundary - except it's going to cut out any pixels that go outside the layer boundary,
crop to result is going to crop everything so that it basically looks like a normal layer
and it's going to crop out all the excess pixels that maybe stick out of the original boundary,
and crop with aspect is going to crop the final result but it's going to maintain
the original aspect ratio of the image. So if you do want to keep the original aspect
ratio I recommend going with crop with aspect, otherwise I typically go with crop to result.
So once we have those settings selected all I need to do is click and drag my mouse along the horizon
I want to straighten - so it doesn't necessarily have to be an actual horizon like you see here,
but if I hold ctrl and zoom in you'll see the angle at which this is being corrected. So the
little line here is going to be the original and the longer line is going to be the new angle.
So once I'm ready to straighten this out I can come over here and click "Straighten."
If you're using a larger image like I am this could take a couple moments, otherwise if
you're using a small image it should be pretty quick. Real quick, don't forget to check out my
website at DaviesMediaDesign.com - I have tons of free software tutorials on here as well as help
articles so definitely check that out. You can get more content by becoming a DMD Premium Member,
and you can enroll in my GIMP 2.10 Masterclass: From Beginner to Pro Photo Editing on Udemy,
and I'll include a link to this as well as all the relevant links from this tutorial in the
description of the video. But here you'll see my final image - so the horizon has been straightened
out. If you're not happy with the result I recommend you undo it and try again because again
this is a transform tool which means if you were to just straighten this once again from this point
it's going to lose quality again. So every time you perform a straightening it's losing quality.
So I recommend undoing it and then retrying. But you'll see the layer boundary here has
cropped out all of the excess pixels that kind of stick out of the layer boundary,
but you'll see the side effect of that is we have all this empty transparency around the border.
The easiest way to fix that is to go to Image>Crop to Content, and that will just sort of shrink
everything down so that we no longer have those transparent areas around the border. And let me
just show you one more example here. So let's say we have a path that we drew using the path tool.
So let's just click and create a simple line here, and let's come back here to the measure tool,
and if I come down here and change the transform option to "path," and let's
come over here to the paths tab and unhide this path, and come back here to the layers panel.
So now if I draw this like so and just follow that path there, and then come over here and
hit "straighten," you'll see now that's going to straighten that path to be a straight line.
So again this doesn't just work with layers it works with paths, selections, or the entire image,
including when you have multiple layers. Alright so that's it for this tutorial,
hopefully you liked it. If you did don't forget to subscribe and click the bell icon to be notified
each time I have a brand new tutorial. You can check out any of the links to my resources in
the description of the video, but thanks for watching and I'll see you next time.