Crop rotated photos
A script-fu for The Gimp
Example
Description
"Crop rotated photos" is a script-fu for the Gimp.
To correct photos showing slightly slanted horizon lines or slanted vertical axes, you need to rotate the image by a small angle with an image editor. After such a rotation you get an image with slanted edges. Some image editors will eventually crop these slanted edges away automatically while others don't.
The Script-Fu "Crop rotated photos" for the Gimp is a function that crops automatically the slanted edges of rotated pictures and keeps the original aspect ratio.
On the example above we did not check the check box of the script, so that the result is not yet cropped but shows through a seleted area where the script would crop. However, if you check the checkbox of the script, the image will be cropped after execution of the script.
It has been tested with The Gimp version 2.2.9 on Linux SuSE and with The Gimp version 2.2.3 on Windoze.
The script version 1.10 has been tested with The Gimp version 2.4.0 on Linux Ubuntu 7.10 Gutsy Gibbon.
Versions
2007.10.26 : The current version is 1.10 and has been adapted to The Gimp 2.4.
Download:
Click into the blue frame below where the script is listed.
Type
Control-A to select the complete text of the script.
Type
Control-C to copy the script to the clipboard.
Go to your text editor (gedit, Kate, Aedix, Notepad, etc) and type
Control-V to paste the script.
Save it as a file named
crop-rotated-photo.scm
Linux Ubuntu or other Gnome: use the text editor gedit or bluefish
Linux Kubuntu or other KDE: use the text editor Kate or Quanta
Mac OS X: use the text editor Smultron
Windoze:
use the text editor Aedix (free), or Notepad (but beware of the file extension .txt which is unwanted, the script file must have the extension .scm and not .scm.txt)
Other text editors are ok too, but word processors are not. Do not use Word, OpenOffice or similar tools.
Installation:
Copy
crop-rotated-photo.scm into one of the directories registered in the Gimp preferences under Folders/Scripts.
Linux Ubuntu and many others:
/home/[username]/.gimp-2.n/scripts or
/usr/share/gimp/2.0/scripts
Linux SuSE:
/home/[username]/.gimp-2.n/scripts or
/opt/gnome/share/gimp/2.0/scripts
Windoze:
C:\.gimp-2.n\scripts or
C:\program-files\gimp2.n\share\gimp\scripts
Then go to the menu Xtns and select Xtns/Script-Fu/Refresh Scripts. That's it.
You need to rotate your image by a small angle
before calling the script "Crop Rotated Photo".
Successor:
The newer script
correct-horizon does both things, it rotates and crops the photo.
Script-fu crop-rotated-photo.scm for The Gimp
Sponsorship
If you find the script 'Crop rotated photos' useful and want to support the developer, you can
License
The
GNU general public license applies to the script-fu
crop-rotated-photo.scm above.