Switch to full style
Ask all general Gimp related questions here
Post a reply

Gradient from Image

Mon Jun 17, 2024 1:39 am

GIMP Version: 2.10.38
Operating System: Linux
OS Version: Ubuntu 24.04
GIMP Experience: Intermediate Level

List any relevant plug-ins or scripts:
http://gimpchat.com/viewtopic.php?f=9&t=14068

https://github.com/pixlsus/registry.gim ... g-path.scm




Hi, I am trying to add a silver gradient inside Inkscape. To do that I need to create a gradient out of image through GIMP. I have the silver texture and tried to use Rob Antonishen (scm) and trandoductin 's (.py file ) work to achieve the same. But I do not get any option to create gradient even though I added both to Home > .config and Home >.var

I am using the Flatpak version of GIMP 2.10.38.

It would be nice to know if there is any method to generate gradient from images. Thanks.

Re: Gradient from Image

Mon Jun 17, 2024 2:15 am

Hi meetdilip
Open an image and make a path
Tools - create a new gradient along the path
write a name for it
you will get your new gradient on your list.
I hope it helps
Here my plug-in

Re: Gradient from Image

Mon Jun 17, 2024 2:54 am

Hi, thanks.I add it to Home > .config > GIMP > 2.10 > plugins

But I do not see any options under Image or tools. Thanks.

Screencast - https://imgur.com/8nIkbGQ

Re: Gradient from Image

Mon Jun 17, 2024 3:15 am

Yeah, flatpak - a real PITA

It probably depends on if you already have a regular existing Gimp 2.10 installation. This in a Mint 20 VM and a Gimp 2.10.36 flatpak. (A bit old but I can not be bothered to update, just useful for demos)

Two possibilities.
(1) The flatpak gimp_gmic_qt plugin.

01-flatpak.jpg
01-flatpak.jpg (135.41 KiB) Viewed 415 times


A bit strange, the new gradient appears in the old Gimp 2.10 gradients folder (2) not the .var (1) one which you might expect.

(2) RobA's script. This did not show when in either of the regular script folders .config... or .var.... I had to make a scripts folder in home (3) and add the location to the Preferences -> Folders -> Gradients scripts paths.

02-flatpak.jpg
02-flatpak.jpg (140.49 KiB) Viewed 415 times


It does work, beware of the dialog "popping under" the Gimp window. Refresh the gradients for a write to... the old Gimp 2.10 gradients folder again. (4)

Re: Gradient from Image

Mon Jun 17, 2024 4:19 am

Hi, I get this error when trying the G'MIC option

Screenshot from 2024-06-17 14-45-56.png
Screenshot from 2024-06-17 14-45-56.png (117.79 KiB) Viewed 399 times


I created a folder in Home as gimp_script , then Edit > Preferences, added the folder to Script path

But neither under Image or Tools I could find the path to gradient option. I am using the latest 24.04 by the way.

Re: Gradient from Image

Mon Jun 17, 2024 4:32 am

Luckily, I was able to call the script using /

When I ran it, it works but I cannot find .ggr anywhere. Neither under .config not under .var

Screenshot from 2024-06-17 15-00-05.png
Screenshot from 2024-06-17 15-00-05.png (20.22 KiB) Viewed 394 times


Screenshot from 2024-06-17 15-00-57.png
Screenshot from 2024-06-17 15-00-57.png (32.17 KiB) Viewed 394 times

Re: Gradient from Image

Mon Jun 17, 2024 4:40 am

Just used the gimp_gmic_qt plugin again, this time my regular Gimp 2.10.38 and gmic 3.4 - works as expected - puts the gradient file in .config....etc Maybe try updating the gmic filters in the flatpak Gimp. Edit: or it might be the name you have given. Try something simpler, without the path.

RobA's script is registered as context. -> Right Click in the Gradients Dock, it is down at the bottom of the menu.

Obviously works for me, all depends on your setup.
--------------
FWIW a couple of videos
https://i.imgur.com/RFYUdrz.mp4 This one using gmic. I have a file manager open in both .var and .config gradient folders. Refresh the gradients to write. The file goes in .config. ...gradients here.

https://i.imgur.com/FKNYxLN.mp4 This using RobA's script. File manager shows it is my Home partition. Note that when starting the script it pops under and you need to bring it to bring it up. Same as before, refresh the gradients (or close Gimp) to write the file.

Re: Gradient from Image

Mon Jun 17, 2024 5:56 am

G'MIC - I managed to run it without errors. I save to Picture > MyFolder , the whole process went without errors but nothing inside the folder, I named the file 123

Edit 1:

I found the silver.ggr under gradients. Not sure where the .ggr file is though. I searched the whole Home folder for .ggr, all it gave back was a custom.ggr file.

Re: Gradient from Image

Mon Jun 17, 2024 6:06 am

Finally ! I don't know what was wrong or how it got fixed. The .config > Gradients folder is full of .ggr now :)

Screenshot from 2024-06-17 16-35-34.png
Screenshot from 2024-06-17 16-35-34.png (22.52 KiB) Viewed 372 times

Re: Gradient from Image

Mon Jun 17, 2024 6:10 am

Awesome!!

When I called through the Gradient tab / dock ( it was not there first, I added ) the Rob A script works great.

I am so happy it worked :)

Thanks.

Re: Gradient from Image

Mon Jun 17, 2024 7:02 am

meetdilip wrote:I am so happy it worked :)


Got a result anyway ;)

I searched the whole Home folder for .ggr, all it gave back was a custom.ggr file.


Reminded me of this from long ago.

If it's there, and you can see it, it's real. 
If it's not there, and you can see it, it's virtual. 
If it's there, and you can't see it, it's transparent. 
If it's not there, and you can't see it, you erased it. 

Re: Gradient from Image

Wed Jun 19, 2024 9:17 pm

Ha ha. I guess the trick is to close GIMP and search the .config

The .ggr won't appear until then.

Re: Gradient from Image

Thu Jun 20, 2024 3:40 am

meetdilip wrote:Ha ha. I guess the trick is to close GIMP and search the .config

The .ggr won't appear until then.


In the Gradients list dialog there is a menu entry to refresh the gradients (and likewise for the Patterns, Fonts, Brushes..., the only exception being the Python plugins)

Re: Gradient from Image

Thu Jun 20, 2024 5:17 am

I did mention that in an earlier post.

Same as before, refresh the gradients (or close Gimp) to write the file.

Rule number one, never read the thread from the beginning. Rule number two, see rule number one

Re: Gradient from Image

Sat Jun 22, 2024 7:43 pm

rich2005 wrote:I did mention that in an earlier post. Same as before, refresh the gradients (or close Gimp) to write the file.
Rule number one, never read the thread from the beginning. Rule number two, see rule number one

:rofl :rofl
Sorry, but I could not stop laughing :mrgreen:
Post a reply