Straighten a photographed document
There is no scanner around, and the photo of the sheet comes out skewed and squashed on one side. Here you mark the four corners and the document becomes a straight rectangle, in black and white like a scan if you want. The photo stays on your device.
It is not a rotation: it is perspective
Turn the photo by a few degrees and the sheet is still a trapezium, with the far side shorter than the near one: that is perspective, and no rotation or crop straightens it. What is needed is pulling the four corners back into a rectangle and carrying every pixel in between along with them. It is the calculation scanner apps do, and here it is done inside your browser, without sending off a document that might be a contract or an identity card.
Why exactly four corners
Because with fewer the problem has no single answer: two points only say where one side ended up, three are not enough to work out how the sheet narrows. Four are, and that is why every scanner app makes you drag four dots. Here the sheet is looked for on its own as soon as you load the photo, but the dots stay where you can move them: they have the last word, not the program.
The automatic search is not magic, and it says so
The sheet is found as the largest light patch on a darker background. That works well on a wooden table or on the floor, and does not work when the surface is as light as the document: there is simply nothing to separate there. In that case the page says so and leaves you the four dots to place by hand, instead of inventing a random rectangle and letting you find out afterwards that it was wrong. The signal is simple: a sheet fills nearly all of the quadrilateral of its corners, any other patch does not.
Black and white done in windows
«Like a scan» does not mean turning the contrast up: it means deciding for every pixel whether it is paper or ink. A single threshold for the whole photo turns the shadow of your hand on one side black and washes the other out; here each point is compared with the average of the ones around it, so the shadow goes and the text stays black. It is the trick that makes a skewed photo of a yellowed sheet readable.
What comes out, and what to do with it
What comes out is a straight image, at the resolution the sheet had inside the photo (asking for more does not add detail, it invents it). You can keep the proportions as measured or impose those of an A4, turn it by 90° if it is lying on its side, and download it. If you need a PDF go through Images to PDF, and if you want the text to be copyable there is Image to text, which works far better on a straightened document than on a skewed photo.