Photo perspective correction with the GIMP
When you are trying to make a photo real texture you probably know that the photo you want to use has never been taken from the front of the building. Often it has been taken at a certain angle, with the result that there is a certain amount of perspective in the photo. In this article I will describe how you can very easy remove this perspective with GIMP.
Some of you might be thinking, what is GIMP? GIMP is a graphical program, just like PhotoShop and Paint Shop Pro. But the good part is that you can use GIMP for free. Yes, you read that correct GIMP is free, it is originally a Linux application, but there is also a version for Windows. You can read more about GIMP if you go to their website.
If you want to get the Windows version right away you can best pay a visit to this site.
GIMP does contain almost all the features the other graphical programs have as well, but this tutorial will only deal with the transformation feature, that also allows you to correct perspective. I have never seen such a good tool, that is also that simple to use to remove perspective from a photo.
(This article is written for an older version of GIMP. I have put some notes in the text for usage of a newer GIMP).
The steps involved
OK, here we go. For this example I will use a photo of the main hangar of Texel Airport I made when I visited the airfield. In figure below you can see how the original photo looks. As you can see there is too much perspective in the photo and it can not be used right away as the basis of a texture.
So, here are the steps you need to take to correct the perspective of such a photo with GIMP:
- The first step is of course to open the photo, the figure above shows how it looks for the example photo.
- The next step is to select the transformation tool of GIMP. (If you are using GIMP ver 2.2 or newer, you should use the "Perspective Tool". Se text below) This tool can be selected by clicking the last icon on the second row of icons, as you can see in figure below. This will give you the properties for the transformation tool as shown on the right side of the figure.
- In that properties window you must make sure that you select perspective (Sorry for the screenshots that are in Dutch, but I have a Dutch version of Windows), otherwise you will end up rotating or scaling the photo. I would also suggest to set the other settings like showed in the figure, these seem to work best for me.
- When you now click on your image you will see that a grid appear, like shown in the figure below.
- GIMP 2.2: In the image window, select "Show Grid" under the View menu. Select the "Perspective Tool". Click on your image.
- If you click on any of the 4 corners of the grid you can drag them around. This way you can select the part of the photo you want to use. You should place the corners in such a way that they define the area that should be rectangular without the perspective. This is easiest done if you have some straight lines on the photo, like doors. In the figure below you can see which area I select in the photo. (Gimp 2.2: drag the corners until the image matches the grid)
- When you are ready with placing the grid and happy with the result you can click the Transform button as shown in the figure below.
- After some calculations you will be shown the final result for your texture. If you are not happy with the result, for example because it still has some perspective you can use undo (Ctrl-Z) to return to the original photo and apply the grid again. In the figure below you can see the final result for the photo I used.
As you can see the scale of the result may not be correct. The corrected image uses the same size as the original photo. Depending on the shape of the area you select this means that it can be stretched too much in horizontal or vertical direction. Of course this can be solved rather easy to resizing the image.
That's all you need to do, to use this simple tool. With this corrected photo you can then make your texture as you always did.