M: I scanned a square, or rather I took a picture of a square canvas with my phone because I can't find my scanner. Now I'm trying to use GIMP on Linux to turn it into an actual square, you know, deal with all of the perspective and all of that. What's the simplest way to do it?
G: TL;DR: In GIMP, use Tools → Transform Tools → Perspective (or Unified Transform) and drag the four corners of the canvas in the photo until they match a square grid. Then crop. That’s the fastest manual method.
This works because the perspective tool maps your skewed quadrilateral to a rectangle.
If the photo has rotation + perspective distortion:
This tool is basically GIMP’s closest equivalent to Photoshop’s Free Transform.
This gives the most accurate result.
1. Turn on snapping
View → Snap to Grid
View → Show Grid
Then set grid spacing under:
Image → Configure Grid
2. Overshoot the canvas When correcting perspective, the edges may distort. It's fine — just crop afterward.
GIMP can do this semi-automatically using G’MIC plugin → Repair → Perspective correction, but it requires installing the plugin.
If you want, you can drop the photo here, and I can also show the exact corner points to drag. That usually takes about 30 seconds once I see the distortion pattern.
M: Check online for what you're doing. What you gave me is almost what I need, but like in the exact opposite direction. Your version doesn't let me select the area. It automatically selects the canvas and then starts screwing with it. So I don't get to select the actual intended square area.
G: You’re running into a
specific behavior of GIMP’s transform tools:
If no selection exists, the transform tool
automatically grabs the entire layer and distorts it.
citeturn0search3
So what you’re seeing is expected — GIMP assumes you want to transform the whole image.
The trick is: you must define the region first, then run the transform.
Below are the two methods that actually behave the way you want.
This is the “fix photographed document” workflow.
Shift+P).Because a selection exists, the perspective transform now operates only on that selection, not the whole layer. citeturn0search0
This workflow literally tells GIMP:
“Take this quadrilateral and flatten it into a rectangle.”
This tool actually lets you draw the region you want to deform, which is closer to what you described wanting.
Steps:
The cage tool works by defining a deformable polygon around an area and then moving the anchor points. citeturn0search15
For photographing paper, paintings, canvases, etc:
That’s the fastest practical workflow. citeturn0search20
✔ If you want, show the photo.
There is also a very fast 3-step method using the Handle
Transform tool that many GIMP users miss, and for a
photographed canvas it’s usually the cleanest fix.
M: Okay, I figured out what it was. You basically gave me a set without a step zero, which was to select the canvas and then follow your methods. The problem is that while I can almost freehand it, it's not quite the same thing, if that makes sense. I'm trying to get the computer to make it square perfect, not try to freehand it approximately into the right place. Is there any way to do that? Let me try and give the situation again so that you might have a better idea of what I'm trying to do. What I have is a picture of a square canvas, right? Well, what I want to do is select either through a tool or just with the lasso tool and clicking, select four corners and then have the computer say, okay, those are supposed to be four corners of a square or rectangle. Here's what it would look like if it got pulled into that arrangement. So it takes up the entire screen or work area.
G: TL;DR: Yes. What you want is a 4-point perspective correction (homography): pick the four corners of the photographed canvas and map them to a perfect rectangle. In GIMP, the closest built-in tool is the Handle Transform Tool, which lets you place four exact corner points and then force them into a square/rectangle.
This tool lets you define four source points and then move them to four destination points.
Open the image.
Select
Tools → Transform Tools → Handle Transform
(shortcut: Shift + L)
Click the four corners of your canvas in the photo
Press Enter to activate the transform handles.
Now drag those four handles so they form a
perfect rectangle or square.
Use guides or grid for precision:
Press Enter again to apply.
GIMP then computes the full perspective transform and stretches the image so your four points become a perfect rectangle.
This is mathematically the exact operation you're describing.
What you're doing is a projective transform:
skewed quadrilateral → perfect rectangle
The computer calculates a mapping so that:
This is the same math used for:
If you install the G’MIC plugin, it has a filter literally designed for this:
Filters → G’MIC → Repair → Perspective [4 points]
You click the four corners and it automatically outputs a rectangular result.
This behaves exactly like phone “scan document” apps.
After the transform:
四(よん) つ の 角(かど) を 選(えら)ぶ と、画像(がぞう) を
正方形(せいほうけい) に 変形(へんけい) できる。
— “If you choose four corners, the image can be transformed into a
square.”
If you'd like, I can also show a much faster 20-second workflow many GIMP users use for photographed paintings, because there's one tool hidden in the transform menu that makes this almost trivial.