Before the rush

Before the rush
by evan-pak

Submit your Photo
Hall of Fame

Please participate in Meta
and help us grow.

Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used a perspective transformation on an image in GIMP, but not before I forgot to record the transformation matrix it used. (I need to apply the same transformation to a bunch of other images.)

I haven't even saved the image yet; the perspective transformation is still in my undo history. How can I find that matrix?

share|improve this question
up vote 4 down vote accepted

Most of the actions with tools in GIMP can be undone with CTRL+Z and all the settings will be set to the values just before applying them or you can view/reapply the last action with the options from the Filters menu. Unfortunately both are not implemented for the Perspective transform tool (or any of the transform tools IIRC).

Your best option is to copy the transformed image (to the clipboard), undo the transformation, paste as a new layer (from the clipboard) and try to achieve the same perspective correction while comparing with the transformed layer. Before hitting apply and do what you want with your transformation matrix.

Alternatively, get the x and y coordinates of the four corners of the transformation mesh and open Filters > Script-Fu > Console and write down for every image:

(gimp-drawable-transform-perspective (car (gimp-image-get-active-drawable (aref (cadr (gimp-image-list)) 0))) tl_X tl_Y tr_X tr_Y bl_X bl_Y br_X br_Y 0 2 FALSE 3 0)

Replace tl_X to br_Y with their respective coordinates.

tl = top-left
tr = top-right
bl = bottom-left
br = bottom-right

This modifies the last opened image.

share|improve this answer
Why is the matrix 2x2x2 and not 2x2 for linear transform or 3x3 for affine transform? – Thomas Ahle Jun 8 '15 at 18:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.