It is currently Thu Aug 17, 2017 8:02 pm


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: On the subject of computing a gradient, is there a script?
PostPosted: Thu Apr 20, 2017 2:21 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 188
Location: Dane-ish Co., West Gonsin
Or, could there be a script for computing the mathematical gradient for an image of pixels?

A gradient is a vector quantity (having magnitude and direction) which shows, at every point, the direction and intensity of the path of steepest descent (or ascent) from that point.

So a 2D gradient of a 2D image would communicate, at every point, the direction and strength of the quickest way to a lower pixel value. The classic way to do this in physics and other mafth textbooks was to draw a field of tiny arrow of varying directions and lengths. In GIMP, the way 2 independent quantities would appear to be color and brightness.

Alternatively, a "gradient" script could compute the "quickest path to the bottom" from a pre-selected pixel.

I'd be thrilled if someone who knew what I was talking about would take over and speak authoritatively... :^)

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."
And another thing, as you get older, when time is increasingly the most
precious thing you have left, you waste most of it looking for your stuff.


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: On the subject of computing a gradient, is there a script?
PostPosted: Thu Apr 20, 2017 3:47 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 3619
GMIC's GradientRGB, perhaps?

Attachment:
GradientRGB.png
GradientRGB.png [ 414.59 KiB | Viewed 411 times ]


Edit: fun effect: GradientRGB, keep Value, invert:

Attachment:
Butterfly-GradientRGB-Value-Inverted.jpg
Butterfly-GradientRGB-Value-Inverted.jpg [ 113.23 KiB | Viewed 402 times ]

_________________
Image


Top
 Post subject: Re: On the subject of computing a gradient, is there a script?
PostPosted: Thu Apr 20, 2017 4:09 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 188
Location: Dane-ish Co., West Gonsin
Yah, that looks very much like what I had in mind! (Unfortunately, having stretched it so much the first time, it's awful thin now.)

As I've stared at it, I first conclude that the brightness of the pixels on the right indicate the strength of the gradient (slope). The bottom-most white half plane on the left results in black pixels on the right: it must be flat. Colors I'm having a little bit harder time with. If brightness represents strength, colors must represent direction. It makes sense that a circular-ish hole should have gradients in all directions, so all colors should be represented. Sure, and there's a rainbow around the hole. The regularity of the colored tiles in the background threw me, until I guessed that the black and white heightmap on the left represents four angled intersecting planes. If the planes are uniformly sloped to the center, then points anywhere on a plane will have a gradient in the same direction and intensity.

Too many words to say, "I think it works."

Thank you.

Shortly I will check to see if it's helpful to find rivers.

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."
And another thing, as you get older, when time is increasingly the most
precious thing you have left, you waste most of it looking for your stuff.


Top
 Post subject: Re: On the subject of computing a gradient, is there a script?
PostPosted: Thu Apr 20, 2017 4:11 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 188
Location: Dane-ish Co., West Gonsin
@ofnuts re: your fun effect

That looks like an excellent way to get a sophisticated pencil sketch! Wow!

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."
And another thing, as you get older, when time is increasingly the most
precious thing you have left, you waste most of it looking for your stuff.


Top
 Post subject: Re: On the subject of computing a gradient, is there a script?
PostPosted: Thu Apr 20, 2017 4:31 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 188
Location: Dane-ish Co., West Gonsin
Here's the result. The Mississississippi River is not just leapin off the page at me. (I used Filters->G'MIC->Contour->GradientRGB with params 10,0,10.)

To paraphrase the great Inigo Montoya of Princess Bride legend:
"I keep using that word, gradient, but I do not think it means what I think it means.", at least regarding rivers...
Attachment:
USA_GMIC-Contours-GradientRGB_10-0-10.png
USA_GMIC-Contours-GradientRGB_10-0-10.png [ 297.01 KiB | Viewed 400 times ]

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."
And another thing, as you get older, when time is increasingly the most
precious thing you have left, you waste most of it looking for your stuff.


Top
 Post subject: Re: On the subject of computing a gradient, is there a script?
PostPosted: Fri Apr 21, 2017 3:29 am  (#6) 
Offline
GimpChat Member

Joined: Jan 20, 2013
Posts: 6393
Location: roma, italy
You may use also the existing filter CrazyWarhol, if you like.
Attachment:
BW, as a Warhol painting, 256 areas.jpg
BW, as a Warhol painting, 256 areas.jpg [ 1.52 MiB | Viewed 352 times ]

_________________
Vanitas vanitatum et omnia vanitas.


Top
 Post subject: Re: On the subject of computing a gradient, is there a script?
PostPosted: Fri Apr 21, 2017 6:37 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 188
Location: Dane-ish Co., West Gonsin
dinasset wrote:
You may use also the existing filter CrazyWarhol, if you like.


Thank you! Have you ever looked at a new filter, and then a to-do/wish/bucket list, and then a calendar, and told yourself, "Oh I, really, don't see myself using this one."? I saw CW, and quickly pulled up all the examples I could from memory and confirmed, "Yeah, pretty far from what I have to be doing."

Without your taking the time to show me, I'd have had no conception it could produce such a work.

(And that goes for a host of other GimpChat contributors too. Thank you all. Lurkers take note. ;^) I pass on what a great professor, James Archer, told me once that "50% of any population is above average." I don't know what he meant either, but half the time I find it motivating...)

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."
And another thing, as you get older, when time is increasingly the most
precious thing you have left, you waste most of it looking for your stuff.


Top
 Post subject: Re: On the subject of computing a gradient, is there a script?
PostPosted: Fri Apr 21, 2017 6:52 am  (#8) 
Offline
GimpChat Member

Joined: Jan 20, 2013
Posts: 6393
Location: roma, italy
Now try to use it on some of your USA pictures...(remember to set no.of colour areas to 256).

_________________
Vanitas vanitatum et omnia vanitas.


Top
 Post subject: Re: On the subject of computing a gradient, is there a script?
PostPosted: Fri Apr 21, 2017 7:30 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 188
Location: Dane-ish Co., West Gonsin
dinasset wrote:
Now try to use it on some of your USA pictures...(remember to set no.of colour areas to 256).


" Have you ever looked at a new filter, and then a to-do/wish/bucket list, and then ..."
Oh, alright. :^)

BTW, I remind readers that (most) scripts and plug-ins are text files (and hence readable) and (near the end) they have the information about where the procedure will be found in the GIMP menu system. (Readable files are also editable, so be careful.) In this case the entry is:
menu="menu="<Image>/Diego/Quantize"
putting it in the top-level GIMP menu--and in my mind asserting that the "Diego" menu should be considered of equal importance to "Image," "Colors," "Layers," "Tools," and "Filters" menus. I examined the contents of other filters and re-located it to:
menu="menu="<Image>/Filters/Artistic".
Attachment:
USA_CrazyWarholed.png
USA_CrazyWarholed.png [ 458.09 KiB | Viewed 322 times ]

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."
And another thing, as you get older, when time is increasingly the most
precious thing you have left, you waste most of it looking for your stuff.


Last edited by gramp on Fri Apr 21, 2017 7:38 am, edited 1 time in total.

Top
 Post subject: Re: On the subject of computing a gradient, is there a script?
PostPosted: Fri Apr 21, 2017 7:36 am  (#10) 
Offline
GimpChat Member

Joined: Jan 20, 2013
Posts: 6393
Location: roma, italy
Do you like the result?

_________________
Vanitas vanitatum et omnia vanitas.


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

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Gradient Stroke Script V1.4

119

No new posts Script for Creating Gradient from a Path??

3

No new posts Attachment(s) Create New Gradient Along Path (python fu script).

7

No new posts Attachment(s) Add a Stop at offset percentage to a gradient (.py script 2 functions)

4

No new posts Removing subject from background

4



* Login  



Powered by phpBB3 © phpBB Group