It is currently Thu Mar 28, 2024 4:29 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: script-fu: Adding layer in neutral gray in mode soft light (2.7.5)
PostPosted: Wed Feb 29, 2012 9:37 am  (#1) 
Offline
GimpChat Member

Joined: Feb 22, 2012
Posts: 295
Location: Germany
Hi all.

I wrote a script (my first one).
I often need a layer in neutral gray in mode overlay or soft light or hard light
for manipulating contrast in images.
It was not funny to do this always manually, so I wrote a script for it.
Originally in Python, but there was an (already fixed) Error in the plugin-management
in the gimp source, so I ported it to script-fu, because everybody has the
script-fu funcionality in Gimp, but not alwas python.

The script deals with layer groups in Gimp 2.7.5 so it is not functional in Gimp 2.6.xx

Greets
Hatti


Attachments:
addgraylayer.scm [2.35 KiB]
Downloaded 119 times


Last edited by Onkel Hatti on Thu Mar 01, 2012 5:52 am, edited 1 time in total.
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: script-fu: Adding layer in neutral gray in mode soft light (2.7.5)
PostPosted: Wed Feb 29, 2012 7:35 pm  (#2) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Overlay and Soft Light are equivalent...not in theory but for a Gimp bug that as far i know is not yet fixed

So if you want really give the option to chose between the 2 modes (but the result will remain similar, anyway similar is correct identical a bug ) you should emulate the real Soft Light mode

1 swap layer position
2 merge in Hard Light mode

Apply hard light on swapped layers would give correct result IF opacity is 100% ,
less and less when lowering opacity

PS
That bug was never fixed to avoid backward compatibility issue.
Now should be a option to apply the mode with gegl and in case i believe the result would be correct
but you can't ( yet?) call gegl operation from script

apply hard light on swapped layers would give correct result at 100% opacity , less and less when lowering opacity
(also tha

_________________
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: script-fu: Adding layer in neutral gray in mode soft light (2.7.5)
PostPosted: Thu Mar 01, 2012 12:59 am  (#3) 
Offline
GimpChat Member

Joined: Feb 22, 2012
Posts: 295
Location: Germany
Good morning Photocomix.

Sorry, I'm german and I have read your post 4 times, but I don't understand.
What do you mean "emulating soft light mode" by "swapping layer position and
merge in hard light mode"?

The mode can be changed, when the layer is added.
The mode can be changed in the script, where the layer is added.
I didn't want to have a dialog for choosing the desired mode, I just wanted
just a mouseclick, but feel free to "pimp".

The layer thing in gimp is improveable.
I would prefer a "new layer" dialog where you can choose a neutral background
and the possibility to select more than one layer to put them together in a layergroup.

Hatti


Top
 Post subject: Re: script-fu: Adding layer in neutral gray in mode soft light (2.7.5)
PostPosted: Thu Mar 01, 2012 3:55 am  (#4) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Onkel Hatti wrote:
The mode can be changed, when the layer is added.
The mode can be changed in the script, where the layer is added.
I didn't want to have a dialog for choosing the desired mode, I just wanted
just a mouseclick

I understand and agree. Another option is to use the Grain Merge layer mode, which will provide a degree of contrast control somewhere between the Hard Light and Overlay modes.
Attachment:
Lenna-modes.jpg
Lenna-modes.jpg [ 127.64 KiB | Viewed 1904 times ]


For your script, I would point out that if you perform a 'gimp-context-push' at the beginning, and a 'gimp-context-pop' at the end, then it will not be necessary to save and restore your foreground color. Same result, just a different approach.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: script-fu: Adding layer in neutral gray in mode soft light (2.7.5)
PostPosted: Thu Mar 01, 2012 5:12 am  (#5) 
Offline
GimpChat Member

Joined: Feb 22, 2012
Posts: 295
Location: Germany
Thank you, now I see... good example.
I din't know the push/pop option. Thanks. But in this context, it is
not neccessary, I think.

Hatti


Top
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Adding a image as a layer, moving layer, and then flattening

2

No new posts Attachment(s) layer mode preview stopped working

3

No new posts Script-fu skip run-mode parameter (solved)

6

No new posts How do I script a new white layer to the bottom of the layer stack

7

No new posts PARTIALLY SOLVED How does it work on layer blendng mode "Normal"

1



* Login  



Powered by phpBB3 © phpBB Group