You are here

Post Rotate Crop

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!
PostRotateCrop.zip14.98 KB

The attached zip file now includes a Python version of the Post Rotate Crop script. This runs very much faster than the Script-Fu version (which is also included in the zip file for those who don't have Python installed).

Whilst originally intended to be used following a rotation the script can also be used following
other transformations, such as perspective, scale and shear. The transparent areas added to the
image by the transformation are removed to leave an opaque rectangle.

The script provides options that determine how the resulting rectangle should be maximized.

If the opaque area of the image is significantly smaller than the image size it may be more
efficient to manually crop the image so that it is only slightly larger than the opaque area
and then run this script (particularly if using the Script-Fu version).

The script is accessed via Tools/Transform Tools/Post Rotate Crop

The script is not intended to work for opaque areas that include reflex angles.

The attached file includes the script (Script-Fu and Python versions) and a text file of instructions about its use.

There is a new version of the Straighten and Crop script that will use the Python version of the Post Rotate Crop script.

Please note:
There is a problem with GIMP 2.6 (at least up to and including V2.6.11) with the rotation performed using the Sinc (Lanczos3) algorithm. If this algorithm is used the Post Rotate Crop script will produce results that are not as expected. Unless the rotated image is to be cropped manually the Cubic interpolation algorithm should be used.

For more details of the problem see:

Code License: 
GIMP Version: 
Scripting Engine: 


I use the Python version of PostRotateCrop, now with Gimp 2.8.14. Interpolation is set to cubic, as Lanczos3 gave trouble some years ago. I have been getting elongated black triangles in the corners of rotated images after the plug-in has been run.

Could you post one of the images that is giving you problems somewhere that I could download it

Ideally include the original image, the exact steps that you are using to rotate and then crop it and the resulting image. If you can do this I'll see if I can reproduce the problem (I have tried with images of my own and don't see the problem)

Also which version of GIMP and which operating system are you using?

Subscribe to Comments for "Post Rotate Crop"