It is currently Wed Jun 24, 2026 2:31 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 17 posts ] 
Author Message
 Post subject: How does the 'Cartesian transform' filter work ?
PostPosted: Thu Jun 20, 2013 8:30 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2769
its G'MIC -> Deformations -> Cartesian transform

there are two formulas for x and y-warping present....

(w+h)/20 * cos(y*20/h)

what does it all mean ?


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Thu Jun 20, 2013 8:33 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Apr 30, 2010
Posts: 1937
Location: Missouri
Thanks for asking that because I don't know either.

_________________
Image
The last time I kept an open mind,
my brain fell out and the dog grabbed it.
Now it's full of dirt, toothmarks, and dog slobber.
No more open minds or dogs for me.


Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Thu Jun 20, 2013 8:34 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2769
Gms9810 wrote:
Thanks for asking that because I don't know either.
dont worry, i could ask questions about G'MIC for hours ;)

i guess its time to start exploring :bigthup


Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Fri Jun 21, 2013 1:00 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
The G'MIC Cartesian filter is able to locally displace (warp) an image along a displacement vector defined for each pixel (x,y) of the image.
This displacement vector has then two coordinates (u,v) that can be defined by the users as functions of locations (x,y).
You can enter your own formulas to get custom deformation effects.


Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Fri Jun 21, 2013 2:30 am  (#5) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
Or as I like to think of it, the box x-warping calculates how much each pixel will move along the x-axis and likewise for y-warping. So if you put 0 in each box it won't move at all, if you put 20 in the x-warping box the whole image shifts to the right and so on...

I suppose I should add that when you use x or y in those boxes they refer to the location of the pixel currently being worked on.


Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Fri Jun 21, 2013 3:04 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
Hi GC.
Using your great experience on G'MIC you have, you may suggest which formulas to put in order to get a second "water " effect (one is already available with that name) able to show small ripples towards the top and large ripples towards the bottom, as in a lake (perspective effect)

_________________
"Where am I ?"


Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Fri Jun 21, 2013 4:07 am  (#7) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
Actually I'm really terrible at maths stuff :oops:
But I suppose you could take the defaults and multiply both by a value related to y, something like

(w+h)/40 * cos(y*40/h) * (1-y/w)
(w+h)/40 * sin(x*40/w) * (1-y/w)

I'm sure there are shorter ways of doing it and the effect could be better!


Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Fri Jun 21, 2013 5:01 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
Thanks.
I guess the last letter should be h instead of w, to get the effect be related to y without taking into account the width, but only the height
Then one can play with the constant, depending on his/her image...

_________________
"Where am I ?"


Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Fri Jun 21, 2013 5:05 am  (#9) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
Hah sorry yes, I'm also sleepy this morning :(


Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Fri Jun 21, 2013 7:16 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2769
thanks for answers all !

i think i do understand now, but its kind of user unfriendly with the values
tried to put in some values, to see what each change does and still have not much control


Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Fri Jun 21, 2013 7:24 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Clearly this filter is very generic and not user friendly at all. It can deform your image with any warp map you want, and this requires to have an idea of the warping formula, but also to know the G'MIC syntax to specify formulas.


Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Fri Jun 21, 2013 7:29 am  (#12) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Esper wrote:
thanks for answers all !

i think i do understand now, but its kind of user unfriendly with the values

It's not user-unfriendly, but non-mathematician-unfriendly :)

But seriously, a math formula is the simplest and easiest way to describe many things... otherwise you would have a an unwieldy interface with 80 sliders and 120 selectors...

_________________
Image


Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Fri Jun 21, 2013 7:33 am  (#13) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
I agree ofnuts :)


Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Fri Jun 21, 2013 7:39 am  (#14) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2769
i see, that clears it up then

thanks Rononours, for the help

ofnuts wrote:
It's not user-unfriendly, but non-mathematician-unfriendly :)

you are right
from a coder point of view users must seem kind of dumb, while vice versa user probably find that coders are way too much in their abstract world

but i think, in the end, its the user who must be reached, without him having to learn an awful lot of stuff
otherwise a filter is pretty much useless for everybody involved

im a person who is willing to wrap my head around more complicated stuff if i can get something worth the effort out of it, but that doesnt represent the majority of my fellow gimpchatters
i mean, they even want a skript for the most simple effects, which i find really annoying


Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Fri Jun 21, 2013 7:52 am  (#15) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
Esper, I'm the least appropriate person to talk about formulas, to a certain extent I'm close to you, but mainly as far as the documentation is concerned rather than on coding formulas (ofnuts' comment on code choices seems correct also to me, non-mathematician).
Concerning the specific G'MIC command, to play with it I think it's only necessary to understand the three kinds of values involved:
1) sin and cos are used to make distortions going left and right as well as top and down, alternatively (waves..) - try to remove them and you will see only straight lines
2) w(width) and h(height) are used to take care of image dimensions
3) x and y to take care of each specific pixel
the rest are constants, you can play with
As I said: for me - non-mathematician - that's enough to experiment it

_________________
"Where am I ?"


Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Fri Jun 21, 2013 1:26 pm  (#16) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16042
ofnuts wrote:
Esper wrote:
thanks for answers all !

i think i do understand now, but its kind of user unfriendly with the values

It's not user-unfriendly, but non-mathematician-unfriendly :)

But seriously, a math formula is the simplest and easiest way to describe many things... otherwise you would have a an unwieldy interface with 80 sliders and 120 selectors...


You mean like the infamous "Twist" plug-in? :lol

Image

It does make cool looking butterflies though. :)

_________________
Image


Top
 Post subject: Re: How does the 'Cartesian transform' filter work ?
PostPosted: Fri Jun 21, 2013 4:09 pm  (#17) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Rod wrote:
ofnuts wrote:
Esper wrote:
thanks for answers all !

i think i do understand now, but its kind of user unfriendly with the values

It's not user-unfriendly, but non-mathematician-unfriendly :)

But seriously, a math formula is the simplest and easiest way to describe many things... otherwise you would have a an unwieldy interface with 80 sliders and 120 selectors...


You mean like the infamous "Twist" plug-in? :lol

[ Image ]

It does make cool looking butterflies though. :)


Exactly... and the paradox is that it's unusable by both regular users and mathematicians, because they don't know the formula used :)

_________________
Image


Top
Post new topic Reply to topic  [ 17 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group