It is currently Sun Jul 21, 2024 4:18 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Wed Nov 13, 2013 8:00 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Hello there !

I've added a new funny filter in the G'MIC plug-in for GIMP, named Rendering / Equation plot [parametric].
This filter allows to render 2d parametric curves, from (almost) any formula you want. It requires a bit of math skills to generate nice results though, but on the other side, it's a very generic filter.
Here is how it looks (after a filter update) :

Attachment:
gmic_parametric1.png
gmic_parametric1.png [ 152.31 KiB | Viewed 4761 times ]


And some examples of use (preview + parameters used) :

Attachment:
gmic_parametric.jpg
gmic_parametric.jpg [ 371.29 KiB | Viewed 4761 times ]


Very nice, for example to generate nicely shaped hearts, like this one (has been filled in GIMP afterwards) :

Attachment:
gmic_parametric5.jpg
gmic_parametric5.jpg [ 10.26 KiB | Viewed 4761 times ]


Feel free to share your creations with this filter :)
Also, I was not aware of a similar filter available for GIMP, but as I'm not so experienced, maybe I've missed it. Does anyone know some scripts or plug-ins doing equivalent things ?


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: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Wed Nov 13, 2013 9:33 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Mar 23, 2012
Posts: 7316
Location: Göteborg at last!
Image


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Wed Nov 13, 2013 9:40 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12535
Very cool stuff David. Enjoy math as art often. My mood is not in this at the moment, but do look forward to trying it when it is. Appreciate the new preset. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Wed Nov 13, 2013 9:42 am  (#4) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Thanks, very cool.

_________________
Image


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Wed Nov 13, 2013 9:53 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14715
Location: USA
Thanks David. Now i wish i was better with equation plot math. :)
Sort of looks like a crown.
Image

Image

No description
Image

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Wed Nov 13, 2013 9:57 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Mar 23, 2012
Posts: 7316
Location: Göteborg at last!
I'm not really up on Maths, what does t represent?


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Wed Nov 13, 2013 10:07 am  (#7) 
Offline
Script Coder
User avatar

Joined: Nov 06, 2012
Posts: 239
Location: Italy
Well done, David! :bigthup

Where can I find a complete list of all the functions that it is possible to employ for this particular filter?


Flower:

ImageImage



Spiral:

ImageImage

_________________
Gino D's GIMP scripts: https://sites.google.com/site/ginodonig/gimp-scripts


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Wed Nov 13, 2013 10:42 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
@GinoD : Well, the math parser understands most of the 'usual' functions. The reference documentation from G'MIC says a bit more about it (http://gmic.sourceforge.net/reference.shtml#section9).

Here is a copy paste of the relevant paragraphs, for this filter :

Quote:
- The math parser understands the following set of functions, operators and variables:
_ Usual operators: || (logical or), && (logical and), | (bitwise or), & (bitwise and),
!=, ==, <=, >=, <, >, << (left bitwise shift), >> (right bitwise shift), -, +, *, /,
% (modulo), ^ (power), ! (logical not), ~ (bitwise not).
_ Usual functions: sin(), cos(), tan(), asin(), acos(), atan(), sinh(), cosh(), tanh(),
log(), log2(), log10(), exp(), sign(), abs(), atan2(), round(), narg(), arg(),
isval(), isnan(), isinf(), isint(), isbool(), rol() (left bit rotation),
ror() (right bit rotation), min(), max(), sinc(), int().
Function 'atan2()' is the version of atan() with two arguments 'y,x' (as in C/C++).
Function 'narg()' returns the number of specified arguments.
Function 'arg(i,a_1,..,a_n)' returns the ith argument a_i.
Functions 'min()' and 'max()' can be called with an arbitrary number of arguments.
Functions 'isval()', 'isnan()', 'isinf()', 'isbool()' can be used to test the type of
a given number or expression.
_ The variable names below are pre-defined. They cannot be overloaded:
. 'w': width of the associated image, if any (0 otherwise).
. 'h': height of the associated image, if any (0 otherwise).
. 'd': depth of the associated image, if any (0 otherwise).
. 's': spectrum of the associated image, if any (0 otherwise).
. 'x': current processed column of the associated image, if any (0 otherwise).
. 'y': current processed row of the associated image, if any (0 otherwise).
. 'z': current processed slice of the associated image, if any (0 otherwise).
. 'c': current processed channel of the associated image, if any (0 otherwise).
. 'i': current processed pixel value (i.e. value located at (x,y,z,c)) of the
associated image, if any (0 otherwise).
. 'im','iM','ia','iv': Respectively the minimum, maximum, average values and
variance of the associated image, if any (0 otherwise).
. 'xm','ym','zm','cm': The pixel coordinates of the minimum value in the associated
image, if any (0 otherwise).
. 'xM','yM','zM','cM': The pixel coordinates of the maximum value in the
associated image, if any (0 otherwise).
. 'pi': value of pi, i.e. 3.1415926..
. 'e': value of e, i.e. 2.71828..
. '?' or 'u': a random value between [0,1], following a uniform distribution.
. 'g': a random value, following a gaussian distribution of variance 1
(roughly in [-5,5]).
_ These special operators can be used:
. ';': expression separator. The returned value is always the last encountered
expression. For instance expression '1;2;pi' is evaluated as 'pi'.
. '=': variable assignment. Variables in mathematical parser can only refer to.
numerical values. Variable names are case-sensitive. Use this operator in
conjunction with ';' to define complex evaluable expressions, such as
't=cos(x);3*t^2+2*t+1'.
These variables remain local to the mathematical parser and cannot be accessed
outside the evaluated expression.


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Wed Nov 13, 2013 10:51 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Note that it could be fun to try the 'Cupid curve', described in this link :

http://www.wolframalpha.com/input/?i=Cupid+curve

But, I'm not motivated enough to convert the proposed XML equation into G'MIC plain text format.


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Wed Nov 13, 2013 11:21 am  (#10) 
Offline
GimpChat Member

Joined: Jul 11, 2010
Posts: 349
I tried the cupid, but it looks like the are too long for your pgm and it truncates them in the box.

BTW, if you go to the lower left corner of the equation box with your mouse, it shows a dropdown box with symbols. Mouse over the symbols to the one that says "copyable plaintext" click on that and just copy all into a text editor.

Thank you for all your hard work!!!


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Wed Nov 13, 2013 11:34 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
@bilbo9955 : Yes, I've finally tested the cupid curve too, using the 'copyable plain text' option. There are only few modifications to do then to get an equation that is recognized by the G'MIC parser.

So, I wrote a small command '-cupid' (see source here : http://pastebin.com/jxNi4Sbb),
and here is the result I get :

Attachment:
cupid_curve.jpg
cupid_curve.jpg [ 40.75 KiB | Viewed 1807 times ]


There is a black dot located at (0,0), which clearly appears in the computed oordinates. I don't know why it doesn't appear on the wolfram page.


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Wed Nov 13, 2013 12:00 pm  (#12) 
Offline
GimpChat Member
User avatar

Joined: Mar 23, 2012
Posts: 7316
Location: Göteborg at last!
Erisian wrote:
I'm not really up on Maths, what does t represent?


I have some knowledge of sines from sound synthesis and I'm sure cosines are related waves but I haven't the foggiest clue what t represents. Tangent maybe? I know what one of those is.


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Wed Nov 13, 2013 12:21 pm  (#13) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12535
Ronounours wrote:
Note that it could be fun to try the 'Cupid curve', described in this link :

http://www.wolframalpha.com/input/?i=Cupid+curve

But, I'm not motivated enough to convert the proposed XML equation into G'MIC plain text format.


One heck of an equation; I guess each object is plotted concurrently for the discrete result since the plot has time as the variable. Still cool though. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Wed Nov 13, 2013 5:26 pm  (#14) 
Offline
Script Coder
User avatar

Joined: Nov 06, 2012
Posts: 239
Location: Italy
Ronounours wrote:
@GinoD : Well, the math parser understands most of the 'usual' functions. The reference documentation from G'MIC says a bit more about it (http://gmic.sourceforge.net/reference.shtml#section9).
Thanks for the indication. :)

Also note that this filter proves to be an effective tool to depict the Lissajous curves as well as the Rhodonea ones:
http://en.wikipedia.org/wiki/Lissajous_curve
http://en.wikipedia.org/wiki/Rose_curve

In fact, the flower shaped curve that I have attached in my previous post is just the representation of the Rhodonea curve for the special case k = 6.

_________________
Gino D's GIMP scripts: https://sites.google.com/site/ginodonig/gimp-scripts


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Wed Nov 13, 2013 8:17 pm  (#15) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
so i suppose all those are possible http://www.jasondavies.com/rhodonea/

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Fri Nov 15, 2013 5:38 am  (#16) 
Offline
GimpChat Member
User avatar

Joined: Mar 23, 2012
Posts: 7316
Location: Göteborg at last!
Erisian wrote:
Erisian wrote:
I'm not really up on Maths, what does t represent?


I have some knowledge of sines from sound synthesis and I'm sure cosines are related waves but I haven't the foggiest clue what t represents. Tangent maybe? I know what one of those is.


It's been a couple of days now since the above post and a PM to somebody on the subject and I have had no response at all - just total ignorance. I can only assume one of the following:

1. Nobody likes me
2. I was asking a stupid question
3. You thought I was joking
4. Nobody knows the answer

It's plain rude to just ignore somebody when they ask a question - I wouldn't do it to you!


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Fri Nov 15, 2013 6:38 am  (#17) 
t=a fine beverage :hehe
I fell into category 4. So like you was awaiting the answer.


Last edited by fluffybunny on Fri Nov 15, 2013 6:54 am, edited 1 time in total.

Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Fri Nov 15, 2013 6:42 am  (#18) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Erisian, sorry I didn't notice your question :oops:

't' is a variable that can be intuitively considered as the time that would be given by a stopwatch.
* At 't=0', there are no points of the curve that has been drawn.
* When 't' increases, the time goes by and the curve is being drawn more and more.

That's the idea.


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Fri Nov 15, 2013 8:01 am  (#19) 
Offline
Script Coder
User avatar

Joined: Nov 06, 2012
Posts: 239
Location: Italy
Erisian wrote:
I'm not really up on Maths, what does t represent?
The symbol "t" is what is usually called a "parameter", that is simply a numerical value which varies within a certain defined range.
It plays an important role in the parametric representation of a curve, a method that consists in expressing the coordinates (abscissa x and the ordinate y) of every point P belonging to a curve by means of two distinct equations, where the second member is a function of the only parameter t .

x = f(t)
y = g(t)


So that, for each specific value of the parameter t, you will obtain and trace the corresponding point of the curve on the cartesian plane in the form of P(t) = (x(t),y(t)).

One of the simplest examples of parametric curve is represented by the circumference:

x = cos(t)
y = sin(t)


where t varies from 0 to approximately 6.28.


Erisian wrote:
It's plain rude to just ignore somebody when they ask a question - I wouldn't do it to you!
Sorry, there was no intention to appear rude. As for me, I had misunderstood your question since I wrongly read "what does it represent" instead of the correct " what does t represent".
Anyway, notice that you are not the only one who happened to be ignored, as for instance I have not received a single comment yet to the forum topic I created here a month ago by now for reporting a script I wrote, and this disappointed me quite a bit.

_________________
Gino D's GIMP scripts: https://sites.google.com/site/ginodonig/gimp-scripts


Top
 Post subject: Re: New filter 'Rendering / Equation plot [parametric]'
PostPosted: Fri Nov 15, 2013 11:24 am  (#20) 
Offline
GimpChat Member
User avatar

Joined: Mar 23, 2012
Posts: 7316
Location: Göteborg at last!
My apologies to everybody - I often interpret people badly then regret it later - it's part of my illness. Thank you for all your answers.

Dave - that's the direct answer to my question - thanks.
Gino - I would need to learn more maths to understand all that but I'll keep reading through it and see if anything twigs. Thank you.
fluffybunny - we know now!


Top
Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) New filter "Rendering / Spline Spirograph"

4

No new posts Attachment(s) G'mic >rendering> Underwoods

17

No new posts Attachment(s) Rendering Various Textures and Materials

16

No new posts Attachment(s) cli345's cartoon filter as a native GEGL Filter.

10

No new posts Attachment(s) My last Aquarelle filter

21



* Login  



Powered by phpBB3 © phpBB Group