0

I have a picture of a document. The camera was not perfectly perpendicular to the document. The top is shorter than the bottom.

How do I create a free form selection around the document in GIMP, and crop it to a perfect rectangle, gradually compacting/stretching the content so that the document looks perfect?

  • 2
    Hi there and welcome to GDSE. Please add to the tags which application you are using or the question is impossible to answer. If you could add an image of the specific document (or something similar) it would also be very helpful. – Wolff May 10 at 10:56
  • Apologies. Added. – Redsandro May 11 at 13:41
2

What you seem to be describing is not called cropping. What you are trying to do is a type of perspective distortion. In Photoshop you can use Edit > Transform > Distort, to straighten up a photo of a document so it looks perpendicular. There is also a similar Unified Transform tool (Shift+T) in GIMP (which is free).

Example in Photoshop (before and after)

enter image description here

Example in GIMP 2.10* (before and after)

enter image description here

*Note: I can't remember if Unified Transform was in GIMP 2.8, but you can use the Perspective tool (Shift P) which is similar.

| improve this answer | |
  • This is precisely what I am looking for. I forgot to mention that I am using GIMP, apologies. I am looking for this 'universal transform' tool. Could you add to your answer specifically where to find this? It's not in the transform menu (with the rotation tools). – Redsandro May 11 at 13:43
  • Update: The 'cage transform' might be similar, but I'm not sure. It is unusable slow. After moving a point, I have to wait 30(!) seconds for the screen to update on this otherwise smoothly running AMD Ryzen 7 3700X 8-Core with nVidia GeForce GTX 970. – Redsandro May 11 at 13:49
  • 1
    @Redsandro sorry it's actually called "Unified Transfrom". The shortcut is Shift+T, it's also available in the toolbox – Billy Kerr May 11 at 13:50
  • 1
    @Rosandro - this is in GIMP 2.10. Can't remember if it was in 2.8, but there was the Perspective tool Shift+P which is similar, this also still exists in 2.10. – Billy Kerr May 11 at 14:19
1

The best way is to use Gimp's Perspective tool in Corrective mode. You put the 4 corner handles of the tool on the 4 corners of what should be a rectangle, and let it work its magic.

Caution: none of this really restores the actual aspect ratio, your result will be rectangular but stretched in one dimension, you often have to resort to other clues (easy if the paper format is known) to scale the result along one dimension to restore the proper aspect ratio.

| improve this answer | |

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.