It is currently Fri Nov 28, 2014 1:44 am


Latest GIMP Scripts & Plug-ins

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: 262
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 45 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
 Profile  
 
 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: 5877
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
 Profile  
 
 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: 262
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
 Profile  
 
 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: 1312
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 516 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.

_________________
A man who does not read good books has no advantage over a man who cannot read them. -- Mark Twain


Top
 Profile  
 
 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: 262
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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

* Login  

* Subscribe to Gimp Chat's RSS Feed    * Subscribe to Gimp Chat's Tutorial Feed    * Subscribe to Gimp Chat's G'MIC Feed


Powered by phpBB3 © phpBB Group