Re: [Gimp-user] How can I specify the tranformation matrix for a perpsective directly

2008-03-12 Thread Sven Neumann
Hi,

On Tue, 2008-03-11 at 16:53 -0500, Leonard Evens wrote:

 I'm not familiar with gimp code, so I don't understand what this means, 
 but I think I can probably figure it out.  I will give it a try.  In any case,
 it would be even better for my purposes if I could specify where the corners 
 of the handles go and let gimp calculate the matrix for me and apply it.

You can do that using gimp-drawable-transform-perspective.

 By the way, I don't really understand what the purpose of showing the
 matrix is if you can't change it directly.  Its meaning is far
 from transparent to a naive user, and even someone who is sophisticated
 about the math, like me, would have to do some calculations to figure
 out what the transformation will do given the matrix.  It would be
 more useful to know where the corners of the handles will go under
 the transformation.  But in the present situation, it is all I have, so
 I don't propose removing it.

But you can see where the handles will go as that is how you set up the
transformation. I agree that it is not very useful to display the
transformation matrix and perhaps this should just be removed.


Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] How can I specify the tranformation matrix for a perpsective directly

2008-03-11 Thread Leonard Evens
On Mon, 2008-03-10 at 18:22 -0500, Leonard Evens wrote:
 I don't see a way to specify the matrix used to perform a desired
 perspective transformation manually.  Of course, I can adjust it by
 dragging handles, but it would be much easier for me to calculate what I
 need and then enter the elements of the matrix by hand.

I've gotten one response so far, and while interesting, it didn't work
out.

Is there some way to do what I want using a script?

Is there software except gimp which runs under Linux which I could use
instead?

If someone could direct me to the section of the gimp code which
performs perspective transformations, I might be able to extract it and
write my own program to do what I want, but from past experience I don't
place much hope in that.  Gimp code forms a complex network and it is
usually impossible to isolate one particular part and make much sense of
it.  Of course it would be nice if the gimp programmers added the
capability I want to a future version of gimp, but I won't hold my
breath waiting for that.

 
 Needless to say, a typical gimp user would not be able to do this, but I
 am a mathematician who has taught geometry many times during my
 professional life, so I know what to do.  I don't need an explanation of
 how the matrix is formed and what it does since I can work that out by
 experimentation.
 
 The gimp manual is not helpful.  It refers the reader to the section on
 convolution filters, but that appears to have to do with modifying
 pixels in place rather than moving the pixels---a rather misleading
 reference.  Perhaps something entirely different happens if you use the
 full matrix, but the documentation is silent on that matter.
 
 Of course, I can try to produce what I want by moving the handles, but
 for slight adjustments of large images, that is difficult if not
 impossible.  It helps if I increase the magnification enormously, but it
 is still awkward.  It would be a lot simpler to be able to enter the
 matrix elements directly. 
 
 

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] How can I specify the tranformation matrix for a perpsective directly

2008-03-11 Thread Sven Neumann
Hi,

On Mon, 2008-03-10 at 18:22 -0500, Leonard Evens wrote:
 I don't see a way to specify the matrix used to perform a desired
 perspective transformation manually.  Of course, I can adjust it by
 dragging handles, but it would be much easier for me to calculate what I
 need and then enter the elements of the matrix by hand.

There's a PDB procedure that allows you to specify the corners of the
perspective transformation, but it doesn't allow you to give the matrix
directly. It wouldn't be difficult to add this functionality to the
Procedural Database. We would certainly consider a patch to do this.

If you want to give it a try, please have a look at the code in
tools/pdbgen/pdb/drawable_transform.pdb. From this source the wrapper
code for the procedure is generated into
app/pdb/drawable_transform_cmds.c. As you can see in
drawable_transform.pdb, all you need to do is to initialize the
transformation matrix with values taken from the procedure call.


Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] How can I specify the tranformation matrix for a perpsective directly

2008-03-11 Thread Leonard Evens
On Tue, 2008-03-11 at 21:56 +0100, Sven Neumann wrote:
 Hi,
 
 On Mon, 2008-03-10 at 18:22 -0500, Leonard Evens wrote:
  I don't see a way to specify the matrix used to perform a desired
  perspective transformation manually.  Of course, I can adjust it by
  dragging handles, but it would be much easier for me to calculate what I
  need and then enter the elements of the matrix by hand.
 
 There's a PDB procedure that allows you to specify the corners of the
 perspective transformation, but it doesn't allow you to give the matrix
 directly. It wouldn't be difficult to add this functionality to the
 Procedural Database. We would certainly consider a patch to do this.

I'm not familiar with gimp code, so I don't understand what this means, 
but I think I can probably figure it out.  I will give it a try.  In any case,
it would be even better for my purposes if I could specify where the corners 
of the handles go and let gimp calculate the matrix for me and apply it.

By the way, I don't really understand what the purpose of showing the
matrix is if you can't change it directly.  Its meaning is far
from transparent to a naive user, and even someone who is sophisticated
about the math, like me, would have to do some calculations to figure
out what the transformation will do given the matrix.  It would be
more useful to know where the corners of the handles will go under
the transformation.  But in the present situation, it is all I have, so
I don't propose removing it.


 If you want to give it a try, please have a look at the code in
 tools/pdbgen/pdb/drawable_transform.pdb. From this source the wrapper
 code for the procedure is generated into
 app/pdb/drawable_transform_cmds.c. As you can see in
 drawable_transform.pdb, all you need to do is to initialize the
 transformation matrix with values taken from the procedure call.
 
 
 Sven
 

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] How can I specify the tranformation matrix for a perpsective directly

2008-03-11 Thread Bruno Postle
On Mon, 2008-03-10 at 18:22 -0500, Leonard Evens wrote:
 I don't see a way to specify the matrix used to perform a desired
 perspective transformation manually.  Of course, I can adjust it by
 dragging handles, but it would be much easier for me to calculate what I
 need and then enter the elements of the matrix by hand.

Look for the gimp mathmap plugin, it does everything you need.

-- 
Bruno
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] How can I specify the tranformation matrix for a perpsective directly

2008-03-10 Thread Leonard Evens
I don't see a way to specify the matrix used to perform a desired
perspective transformation manually.  Of course, I can adjust it by
dragging handles, but it would be much easier for me to calculate what I
need and then enter the elements of the matrix by hand.

Needless to say, a typical gimp user would not be able to do this, but I
am a mathematician who has taught geometry many times during my
professional life, so I know what to do.  I don't need an explanation of
how the matrix is formed and what it does since I can work that out by
experimentation.

The gimp manual is not helpful.  It refers the reader to the section on
convolution filters, but that appears to have to do with modifying
pixels in place rather than moving the pixels---a rather misleading
reference.  Perhaps something entirely different happens if you use the
full matrix, but the documentation is silent on that matter.

Of course, I can try to produce what I want by moving the handles, but
for slight adjustments of large images, that is difficult if not
impossible.  It helps if I increase the magnification enormously, but it
is still awkward.  It would be a lot simpler to be able to enter the
matrix elements directly. 


-- 
Leonard Evens [EMAIL PROTECTED]
Mathematics Department, Northwestern University

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user