It is currently Thu Jul 30, 2015 7:00 pm


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 10:37 am  (#1) 
Offline
GimpChat Member

Joined: Feb 22, 2012
Posts: 288
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 52 times


Last edited by Onkel Hatti on Thu Mar 01, 2012 6: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 8:35 pm  (#2) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5873
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 1:59 am  (#3) 
Offline
GimpChat Member

Joined: Feb 22, 2012
Posts: 288
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 4:55 am  (#4) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1481
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 711 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.

_________________
I can’t go to a restaurant and order food because I keep looking at the fonts on the menu.


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

Joined: Feb 22, 2012
Posts: 288
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 5 guests


Jump to:  

   Similar Topics   Author   Replies   Views   Last post 
No new posts Batch script: add a predefined image layer, set layer mode, export.

in Gimp Scripts and Plugins

Lumo

7

1261

Tue Aug 12, 2014 2:21 pm

Lumo View the latest post

No new posts Attachment(s) script-fu: adding a layer from selection (2.7.5)

[ Go to page: 1, 2 ]

in Gimp Scripts and Plugins

Onkel Hatti

14

1500

Thu Mar 01, 2012 11:25 pm

bilbo9955 View the latest post

No new posts Scanning in gray and RGB mode

in Gimp Help

sofasurfer

3

445

Sat Nov 06, 2010 9:34 pm

PhotoMaster View the latest post

No new posts Attachment(s) Save Each Paisley Layer As Brush, ei. .gbr (Gray Scale)

[ Go to page: 1, 2, 3 ]

in Gimp Help

Wallace

22

1165

Sat Feb 01, 2014 6:22 am

molly View the latest post

No new posts layer mode

in Gimp Help

dinasset

5

345

Mon Jan 12, 2015 11:39 am

Rod View the latest post



* 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