It is currently Thu Apr 25, 2024 1:06 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Need help to create scripts for photo enhancement
PostPosted: Sat Jun 22, 2013 5:26 pm  (#1) 
Offline
GimpChat Member

Joined: May 12, 2013
Posts: 18
I use all the time two two techniques that I have not found in the plugins. Great techniques, but a pain to do manually for a lot of photos and was wondering if I could make a macro or script or g'mic program out of this? (no experience with any of the above)

The first recipe is for a simple contrast mask as detailed at http://www.gimp.org/tutorials/ContrastMask/. While there are a number of contrast mask techniques most do not look as good as this technique.

Basic Recipe:

1) Duplicate layer to top
2) Desaturate to luminisoty top layer
3) Invert top layer
4) Gaussian Blur top layer to 10/10
5) Set top layer blend move to overlay

The second technique is a tone mapping technique that is one of my favorites for outdoor shots and makes pictures look so much more vibrant without looking artificial. It's detailed here: http://www.youtube.com/watch?v=FMlKVDjJFfY

Basic Recipe:

1) Duplicate base layer to two top layers.
2) Top layer should be desaturated to luminosity
3) Invert top layer
4) Gaussian Blur top layer (10,10)
5) Set opacity of top layer to 60%
6) Merge down top layer to middle layer
7) Middle layer (or now the top layer) should have its blend mode set to soft light (overlay might be the same?)

Any help automating these?


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: Need help to create scripts for photo enhancement
PostPosted: Sat Jun 22, 2013 6:55 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
http://chiselapp.com/user/saulgoode/rep ... 2cb95c14d0

Commands added under "Filters->Artistic".

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Need help to create scripts for photo enhancement
PostPosted: Sat Jun 22, 2013 7:03 pm  (#3) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
Out of interest in gmic they would probably be something like this:

# first method
--luminance -negative[-1] -b[-1] 1% -blend overlay

# second method
[0] --luminance[-1] -negative[-1] -b[-1] 1% -blend[-2,-1] alpha,0.6 -blend softlight


Top
 Post subject: Re: Need help to create scripts for photo enhancement
PostPosted: Sat Jun 22, 2013 8:06 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
SG answered your second request and Contrast mask scripts do exist already. I have 3 CM in my GIMP.
This one replicates your steps to the letter
Attachment:
script-fu-simple-contrast-mask_0.7z [1.42 KiB]
Downloaded 167 times


Top
 Post subject: Re: Need help to create scripts for photo enhancement
PostPosted: Sat Jun 22, 2013 8:37 pm  (#5) 
Offline
GimpChat Member

Joined: May 12, 2013
Posts: 18
saulgoode wrote:
http://chiselapp.com/user/saulgoode/repository/script-fu/artifact/ef32a45f51142a506b8b9abef770fc2cb95c14d0

Commands added under "Filters->Artistic".
Thank you! It worked! :clap :jumpclap :clap :jumpclap :clap :pengy


Top
 Post subject: Re: Need help to create scripts for photo enhancement
PostPosted: Sat Jun 22, 2013 9:25 pm  (#6) 
Offline
GimpChat Member

Joined: May 12, 2013
Posts: 18
garagecoder wrote:
Out of interest in gmic they would probably be something like this:

# first method
--luminance -negative[-1] -b[-1] 1% -blend overlay

# second method
[0] --luminance[-1] -negative[-1] -b[-1] 1% -blend[-2,-1] alpha,0.6 -blend softlight
Thanks for the heads up. Seems amazing that these techniques could be done in one line if possible! Would you get a preview option if you did this in G'mic? That would be cool...


Top
 Post subject: Re: Need help to create scripts for photo enhancement
PostPosted: Sat Jun 22, 2013 9:26 pm  (#7) 
Offline
GimpChat Member

Joined: May 12, 2013
Posts: 18
K1TesseraEna wrote:
SG answered your second request and Contrast mask scripts do exist already. I have 3 CM in my GIMP.
This one replicates your steps to the letter
Attachment:
script-fu-simple-contrast-mask_0.7z
Thanks K1! Noticed your gausian blur is percentage based instead of fixed (probrably a good idea...).


Top
 Post subject: Re: Need help to create scripts for photo enhancement
PostPosted: Sat Jun 22, 2013 10:06 pm  (#8) 
Offline
GimpChat Member

Joined: May 12, 2013
Posts: 18
garagecoder wrote:
Out of interest in gmic they would probably be something like this:

# first method
--luminance -negative[-1] -b[-1] 1% -blend overlay

# second method
[0] --luminance[-1] -negative[-1] -b[-1] 1% -blend[-2,-1] alpha,0.6 -blend softlight
Love Gmic so wanted to try to get your script to work as my first custom filter.

In Ubuntu I create a ~/.gmic file with the following lines of code:

#@gimp Yet another tone mapping script: yatms, yatms
yatms :
[0] --luminance[-1] -negative[-1] -b[-1] 1% -blend[-2,-1] alpha,0.6 -blend softlight

I went into Gmic, refreshed and it showed up great. No preview though? Wonder how I can get that to work... I then ran the script and it said:

***Error in filename ~/.gmic*** Unknown command or filename: '-blend[-2,-1]'

Any ideas on how I could fix that?


Top
 Post subject: Re: Need help to create scripts for photo enhancement
PostPosted: Sat Jun 22, 2013 10:49 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
Just a side note, keep in mind that Overlay mode in GIMP is totally incorrect.
It's a well known legacy bug. You can search this site - this issue has been addressed many times.


Top
 Post subject: Re: Need help to create scripts for photo enhancement
PostPosted: Sun Jun 23, 2013 12:40 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Jan 10, 2013
Posts: 863
I do not understand .... :oops:
Could someone explain?
I looked in "Commands added under" Filters-> Artistic "." in G'MIC and not found in any name that reminds contrast mask.

Then I saw the post K1t, and I was in doubt if it is the script that requested by smithaa02, or would like another.

If this (the K1t) is what smithaa02 requested, ask only runs on Linux or Windows?

Thx!

_________________
bbbbbbbbbbbImage
bbbbbbbbbbb Be patient, English is not my language.


Top
 Post subject: Re: Need help to create scripts for photo enhancement
PostPosted: Sun Jun 23, 2013 1:36 am  (#11) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
garagecoder wrote:
Out of interest in gmic they would probably be something like this:

# first method
--luminance -negative[-1] -b[-1] 1% -blend overlay

# second method
[0] --luminance[-1] -negative[-1] -b[-1] 1% -blend[-2,-1] alpha,0.6 -blend softlight




Akros wrote:
...I looked in "Commands added under" Filters-> Artistic "." in G'MIC and not found in any name that reminds contrast mask.

Then I saw the post K1t, and I was in doubt if it is the script that requested by smithaa02, or would like another.


In the gmic plugin the first method is already implemented:
it is the default used in my old Contrast Swiss Mask filter

"Swiss" stand for Swiss-knife , because the filter may create a standard contrast mask (as in your code and initial request ) using Soft Light or Overlay mode (that in gmic are different, only gimp are identical for bug ), that can be very useful to fix over contrasted photos
But may do also the opposite , use the mask to" boost" the contrast instead than to "soften" , a trick that i found quite useful to quickly fix images with the opposite but not rare problem

_________________
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


Last edited by PhotoComix on Sun Jun 23, 2013 1:43 am, edited 2 times in total.

Top
 Post subject: Re: Need help to create scripts for photo enhancement
PostPosted: Sun Jun 23, 2013 1:38 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Akros,
you should look under GIMP menu "Filters-> Artistic "

edit: it's a Gimp script-fu not a Gmic filter

edit2: obviously, you should previously download it from Saulgoode link
http://chiselapp.com/user/saulgoode/rep ... 2cb95c14d0

_________________
"Where am I ?"


Top
 Post subject: Re: Need help to create scripts for photo enhancement
PostPosted: Sun Jun 23, 2013 2:01 am  (#13) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
P.S
My version as gmic filter (include the first method + its opposite ) is in Light and Shadow/Contrast Swiss Mask/Gmic

Image

About the effect images are more clear than words ...quoting myself ...


"If you check the SKIP button ...then the effect will be the opposite of a traditional Contrast Mask

WHAT SKIP DOES

ORIGINAL

Image
Untitled by jared, on Flickr

Default -NO "skip " option checked

Image
Contrast Swiss Mask - NO skip by PhotoComiX, on Flickr

SKIP enabled

Image
Contrast Swiss Mask -Skip by PhotoComiX, on Flickr

ORIGINAL

Image
Nuclear Winter in Chernobyl by Stuck in Customs, on Flickr

SKIP enabled

Image
Contrast Swiss Mask -Skip by PhotoComiX, on Flickr




it was discussed here viewtopic.php?f=9&t=864&hilit=contrast+swiss+mask with more before/after examples

_________________
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: Need help to create scripts for photo enhancement
PostPosted: Sun Jun 23, 2013 2:17 am  (#14) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
excellent filter, PC! in both uses! Thanks...

_________________
"Where am I ?"


Top
 Post subject: Re: Need help to create scripts for photo enhancement
PostPosted: Sun Jun 23, 2013 3:00 am  (#15) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
smithaa02 wrote:
I went into Gmic, refreshed and it showed up great. No preview though? Wonder how I can get that to work... I then ran the script and it said:

***Error in filename ~/.gmic*** Unknown command or filename: '-blend[-2,-1]'

Any ideas on how I could fix that?


If you're getting errors about the blend command you possibly have an old version of G'MIC... new versions are here:
http://sourceforge.net/projects/gmic/files/

And some help with installing:
http://sourceforge.net/p/gmic/wiki/FAQ/


Top
 Post subject: Re: Need help to create scripts for photo enhancement
PostPosted: Sun Jun 23, 2013 3:18 am  (#16) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
dinasset wrote:
excellent filter, PC! in both uses! Thanks...


To be honest many of my filters are based on simple variations of this basic routine :

As example in graphic novel and graphic boost i did basically the same
..but instead then merge 1 blurred clone with the original there i merge 1 smoothed variation over 1 (sort of ) line-art version of the original , to boost edges and darken outlines.

actually i plan to update this group of filters to add a option to merge back again with another clone of the original (in this case to enhance the colours or, to the contrary to fade back over the original to moderate the effect : yes i love include apparently opposite effects , that for me are just 2 faces of the same coin ... the magic of gmic is that most of the times the "opposites" are may become the 2 extremes of a range , with all the intermediate values available

I miss so much support for presets in gmic...but even is David is not against , in theory, in practice and for many good reasons it is not in his wish list .

Alas it seems that it is in nobody else wish list :
most of most skilled gmic contributors uses only or mostly the command line version of gmic

And for who uses almost only the command line version it is really difficult understand the utility of
"presets", and even more feel a personal interest to spend time to implement it :gaah

_________________
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: Need help to create scripts for photo enhancement
PostPosted: Sun Jun 23, 2013 3:31 am  (#17) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
go on PC, the results of your..variations are very good.
Me too (as a user, not as a coder) asked some time ago to have "pre-sets" available in G'MIC filters.
If I remember correctly, I got an answer like:
"create a new filter calling the one for which you like a specific pre-set with the parameters values set-ups as you like and save it with the name of the set-up, then repeat for all pre-sets you like..."

_________________
"Where am I ?"


Top
 Post subject: Re: Need help to create scripts for photo enhancement
PostPosted: Sun Jun 23, 2013 3:53 am  (#18) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Actually gmic has a "fav" button that may be used to save a VERY FEW preset

more then a few "favs" would totally screw up the usability of the filter list :
the filter list looks already a bit hard to browse even if the filters are all grouped in subcategory , alas
fav can't be "grouped" as normal filters, their list is always expanded

Just counting my own presets i created about 50 (all quite different each others) for each filter i wrote , that means more then 600
more i created presets for several other filters i use often ... let say at least another 150
Could you image the effect that would have in the gmic filter list the addition of 650 new entries that can't be organized in subcategory to toggle or expand (as the normal filters ? )

Let say that more then a dozen of presets start to be hard to manage , as now will be totally impossible manage 650 (or even 100 )

_________________
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: Need help to create scripts for photo enhancement
PostPosted: Sun Jun 23, 2013 6:04 pm  (#19) 
Offline
GimpChat Member
User avatar

Joined: Jan 10, 2013
Posts: 863
Dinasset / PhotoComix

Ok, now I understand!
I tried the filter PC - Contrast Swiss Mask / GMIC, and although it has a different outcome of the method described in step 2 above, still proved to be a very good choice!

I confess that like many other filters in Gimp and G'MIC, I never tested it before, nor dreamed for serving!

Thx guys!

smithaa02,

Reading your request, I checked the links and learned the technique. How do I use this feature very little, so the script will not be necessary, since it would be a few steps and adjustments would be more customized to each image.

Thank you for sharing this technique!

_________________
bbbbbbbbbbbImage
bbbbbbbbbbb Be patient, English is not my language.


Top
 Post subject: Re: Need help to create scripts for photo enhancement
PostPosted: Sun Jun 23, 2013 7:34 pm  (#20) 
Offline
GimpChat Member

Joined: May 12, 2013
Posts: 18
Photocomix thanks for the script reference! It does produce a slightly different look so I can use both that or the original as context determines. Both are good contrast mask techniques.

In refererence to the tone mapping (the second more complicated request), I've gone ahead and create a ~/.gmic file with the below code and it works great after I refresh gmic (love Gmic's built in preview options!).

One question for anybody familiar with gmic... I want to have a dropdown choice where one could chose the different blend modes (softlight, overlay, maybe hardlight, maybe multiply).

When I do this it crashes though? Any ideas? Below is the code that works for me in ~/.gmic just before I try to assign variable 3 to the blend mode:

---------------------------------------------------------------------------------

#@gimp Yet Another Tone Mapping Script: yatms, yatms
#@gimp : note = note("This filter is designed to reduce global contrast while increasing local contrast. While other tone mapping scripts work, this is handy because it does a better job of protecting saturation and preserving a realistic look, while making outdoor high dynamic shots look more vibrant.")
#@gimp : sep = separator()
#@gimp : Blur Percent for Aggregate Contrast (100 is 100%) = float(.1,0,100)
#@gimp : Blend opacity of Aggregate Contrast Adjustment Layer (1 is 100%) = float(.6,0,1)
#@gimp : Blend mode for Local Contrast = choice("softlight","overlay")

yatms :

[0]
--luminance[-1]
-negative[-1]
-b[-1] $1%
-blend[-2,-1] alpha,$2

-blend overlay

---------------------------------------------------------------------------------

BTW, I was hoping to share this (and possibley other scripts) with friends and family. How exclusive is the public g'mic library? Can the public add scripts to the main library? Or should we just share .gmic files? (pain for windows users)


Top
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Photo enhancement

6

No new posts Attachment(s) Create Wall Photo Strips plugin

4

No new posts ERROR MAP OBJECT CREATE A PHOTO CUBE

2

No new posts Attachment(s) Create a Shape Cluster Photo Display plugin

5

No new posts How to Add background space to create bigger photo i gimp

4



* Login  



Powered by phpBB3 © phpBB Group