It is currently 07 Aug 2020, 03:15

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Apply and Save/Load Preset Script for Layer Effects (Experimental)

Share your Python Fu Scripts/plug-ins for GIMP here
tim
GL Blogger

Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)

Post#31 by tim » 16 Dec 2018, 16:10


I think the error is just GIMP's front end type checking and not letting anything other than color type to pass through.
I don't know how to get around that.
aka Tin
:tree_02:
Tin's: Favorite Index | Simple Art === fb4yt video search | fb4yt recent video views report
Lottery numbers from image | Interested Members in TLF
Paying for hosting is to support my hobby, and donating money made from ads to The Red Cross.
         
0

Dionísio
Forum Member

Post#32 by Dionísio » 16 Dec 2018, 16:50


Enjoying it so much!
It would be cool to have a option to call more than one filter successively.
I made a candle preset following Blue Lightning TV as a guide. Just apply the presets in order (Bevel/Emboss, Inner Glow, Stroke);

Bevel & Emboss
candle|(image,layer,1, 65.0, 0, 54.0, 10.0, 100.0, 30.0, 0, (255, 255, 255), 4, 75.0, (0, 0, 0), 3, 75.0, 0, False, 'Rain', 100.0, 100.0, False, True)

Inner Glow
candle|(image,layer,(0, 0, 0), 75.0, 0, 0.0, 9, 1, 0.5, 16.0, True)

Stroke
candle|(image,layer,(0, 0, 0), 100.0, 0, 3.0, 50.0, True)
Attachments
candle.jpeg
candle.jpeg (26.38 KiB) Viewed 1799 times
0

tim
GL Blogger

Post#33 by tim » 16 Dec 2018, 18:54


Break-through with version 6 along with altered layerfx.py
short story: You can use gradient for inner_glow and outer_glow and gradient/pattern for stroke
long story: layerfx.py's definition of front end only accepts PDB_COLOR, I changed it to PDB_STRING so that gradient and patterns can be passed in tuples or string, then inside the procedures before validation I try to convert it back to gimpcolor.RGB which is default type for color, and if it's gradient then it's just a string and it works. For stroke I try to convert it to tuple, if the first element is an int i try to make it gimpcolor.RGB, else it's just a tuple representing gradient params or pattern params and now it's all good.
aka Tin
:tree_02:
Tin's: Favorite Index | Simple Art === fb4yt video search | fb4yt recent video views report
Lottery numbers from image | Interested Members in TLF
Paying for hosting is to support my hobby, and donating money made from ads to The Red Cross.
         
0

tim
GL Blogger

Post#34 by tim » 16 Dec 2018, 21:04


Dionísio wrote:
16 Dec 2018, 16:50
Enjoying it so much!
It would be cool to have a option to call more than one filter successively.
I made a candle preset following Blue Lightning TV as a guide. Just apply the presets in order (Bevel/Emboss, Inner Glow, Stroke);

Bevel & Emboss
candle|(image,layer,1, 65.0, 0, 54.0, 10.0, 100.0, 30.0, 0, (255, 255, 255), 4, 75.0, (0, 0, 0), 3, 75.0, 0, False, 'Rain', 100.0, 100.0, False, True)

Inner Glow
candle|(image,layer,(0, 0, 0), 75.0, 0, 0.0, 9, 1, 0.5, 16.0, True)

Stroke
candle|(image,layer,(0, 0, 0), 100.0, 0, 3.0, 50.0, True)
Dionisio, since you've named all your presets the same name (candle), I thought I would write a "Load Preset Apply All" which loads all the presets, and you can choose "candle" and it'll try to apply all layer effects presets that are named "candle". I hope this satisfies your needs for running more than one preset at the same time. Try it out in version 7 (or later) and let me know if this works to fit your needs.
aka Tin
:tree_02:
Tin's: Favorite Index | Simple Art === fb4yt video search | fb4yt recent video views report
Lottery numbers from image | Interested Members in TLF
Paying for hosting is to support my hobby, and donating money made from ads to The Red Cross.
         
0

tim
GL Blogger

Post#35 by tim » 17 Dec 2018, 19:12


version 9 (hack to allow new layer modes [in addition to legacy modes] to be selected to be saved and applied as presets and loads works with these new layer modes as well)
I believe this is what @Krikor asked for about layer modes.
aka Tin
:tree_02:
Tin's: Favorite Index | Simple Art === fb4yt video search | fb4yt recent video views report
Lottery numbers from image | Interested Members in TLF
Paying for hosting is to support my hobby, and donating money made from ads to The Red Cross.
         
0

Dionísio
Forum Member

Post#36 by Dionísio » 17 Dec 2018, 22:47


Downloaded! Going to run some tests. I got stuck making some world maps in GIMP, I'm thinking where I could apply some layer effects in these.
0

Dionísio
Forum Member

Post#37 by Dionísio » 17 Dec 2018, 23:05


So, I tried opening a new image and trying my old "candle" preset in the new apply all. It got an error on the inner glow layer; I tried re-doing it (the preset) but the problem persisted. In both cases the bevel/emboss worked without problems, but any affect after inner glow didn't. The screenshot:

(edit: the new layer modes seems to be working fine though, in the individuals apply/save and load)
Attachments
error.png
error.png (165 KiB) Viewed 1700 times
error2.jpeg
error2.jpeg (38.13 KiB) Viewed 1700 times
0

tim
GL Blogger

Post#38 by tim » 18 Dec 2018, 02:47


@Dionísio ,
I was able to reproduce your error using your "candle" settings.
The problem is caused because you chose to Merge with layer, so after the first effect is applied, the pointer to the old layer is no longer valid because the newly merged layer is a new layer.
So I have changed the script (version 10) to run of based on layer name this way it doesn't error out, it always tries to apply the next effect based on the same layer name which can be a new resulting layer which is fine.
Please give version 10 a try and let me know.
aka Tin
:tree_02:
Tin's: Favorite Index | Simple Art === fb4yt video search | fb4yt recent video views report
Lottery numbers from image | Interested Members in TLF
Paying for hosting is to support my hobby, and donating money made from ads to The Red Cross.
         
0

Dionísio
Forum Member

Post#39 by Dionísio » 18 Dec 2018, 20:25


Words cannot express how much I love this.
Ran a few tests, applying the same presets on the same text varying it's size.
Amazing plugin! :gimp_clap:
Attachments
testeffect.jpeg
testeffect.jpeg (30.39 KiB) Viewed 1553 times
0

tim
GL Blogger

Post#40 by tim » 18 Dec 2018, 20:33


@Dionísio ,
Right on, I am very glad you like it.
aka Tin
:tree_02:
Tin's: Favorite Index | Simple Art === fb4yt video search | fb4yt recent video views report
Lottery numbers from image | Interested Members in TLF
Paying for hosting is to support my hobby, and donating money made from ads to The Red Cross.
         
0


GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 20 guests