NO CODING KNOWLEDGE REQUIRED !
Gmic is constantly updated but sometimes the update may have unpleasant side effect:
as example user's presets broken by changes in some filter, or just was preferred the old version of some filter
It may even happen that an old filter had a bug but somebody find an artistic use of the bug's consequences and now he miss the bug
Doesn't matter why you miss the older version of some filter
Whatever is the reason you may resurrect the old filter, i will show you how
NOTE FOR LINUX USERS
This how to is tailored for Win users but the differences are minimal
For linux the most relevant difference is that the .gimp_def.xxxx file is a hidden file in your home directory, and you should just enter in the "view" menu of Nautilus or whatever is your file viewer and chose "Show hidden files"
And you will have a different text editor but it could be used exactly in the same way
Material
Windows users need a decent test editor because the windows notepad sucks so just grab and install this
http://download.tuxfamily.org/notepadpl ... taller.exe(if you want to know more about see
http://notepad-plus-plus.org/ )
WHAT YOU NEED TO KNOW
The code of all the Filters included in gmic is in a file called .gimp_def.xxxx were xxxx correspond to the gmic version number so as now would be .gimp_def.1504
And old files are (usually) not overwritten by gmic update
In windows 7 the .gimp_def.xxxx file is in C:/Users/Your_Name/AppData/Roaming, in Win XP in C:/Document and Setting/Your_Name/AppData
Now you want to resurrect the earlier version of a filter modified by an update, suppose just to make an example that is Unsharp Mask modified by an update to gmic 1.0.5.4 to 1.0.5.5
Start Notepad++ click File /open and open the .gimp_def.1.0.5.4 file...
Now find something there may seems hopeless but look the Notepad+ menu and click Search/Find
Attachment:
find.jpg [ 175.06 KiB | Viewed 5826 times ]
The name of all the filters of the gmic plugin start with "#@gimp" ...so if you want to resurrect "Unsharp mask" you should search for "#@gimp Unsharp mask" ...click Find and
Attachment:
search.jpg [ 229.11 KiB | Viewed 5826 times ]
done...now the never-ending file was automatically scrolled to show you the right code
select and copy the filter code, create a new file ( File/New ) and paste there the code that will look as
Quote:
#@gimp Unsharp mask : gimp_unsharp, gimp_unsharp_preview(0)
#@gimp : Sharpening type = choice(0,"Gaussian","Bilateral")
#@gimp : Spatial radius = float(1.25,0,20)
#@gimp : Bilateral radius = float(30,0,60)
#@gimp : Amount = float(3,0,10)
#@gimp : Threshold = float(0,0,20)
#@gimp : Darkness level = float(1,0,4)
#@gimp : Lightness level = float(1,0,4)
#@gimp : Iterations = int(1,1,10)
#@gimp : Negative effect = bool(0)
#@gimp : Channel(s) = choice("All","RGBA","RGB","Luminance","Blue/red chrominances","Blue chrominance","Red chrominance","Lightness","ab-components","a-component","b-component","Hue","Saturation","Value","Key","Alpha","ch-components","c-component","h-component","Red","Green","Blue","Alpha")
#@gimp : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical")
#@gimp : note = note{"\n\n<small><b>Note : </b>
#@gimp : This filter is inspired by the original <i>Unsharp Mask</i> filter in GIMP, with additional parameters.
#@gimp : </small>"}
#@gimp : sep = separator(), note = note("<small>Author : <i>David Tschumperlé</i>. Latest update : <i>2010/12/29</i>.</small>")
_gimp_unsharp :
-repeat @# -repeat $8
-if {$1==0} --blur[-1] $2 -else --bilateral[-1] $2,$3 -endif
--[-1] [-2] -*[-1] -$4
--norm[-1] -t[-1] $5% -r[-1] [-2] -*[-2,-1]
-if $9 -*[-1] -1 -endif
--c[-1] 0,100% -c[-2] -100%,0 -*[-2] $6 -*[-1] $7 -+[-2,-1]
-+[-2,-1] -c[-1] 0,255
-done -mv[-1] 0 -done
gimp_unsharp :
-apply_channels "-_gimp_unsharp $1,$2,$3,$4,$5,$6,$7,$8,$9",$10,0
gimp_unsharp_preview :
-gimp_split_preview "-gimp_unsharp ${1--2}",$-1
Now don't get scared by the code...JUST LOOK TO THE VERY FIRST LINE
Quote:
#@gimp Unsharp mask : gimp_unsharp, gimp_unsharp_preview(0)
the first word "#@gimp" just means that is a filter for the Gmic plugin,
after there is "Unsharp mask" that is the name of the filter as will be displayed in the Gmic filter list,
you may wish to change that to avoid confusion so ,as example, you may edit in "Unsharp Mask 2"
NOW THE MOST IMPORTANT after the ":" the REAL filter name, the function name
a name that YOU MUST change to avoid conflict ...and you must change not only in the first line but in all its occurrences
Luckily we may use again the magic of Search/Find this time we use the "replace" tab, write "gimp_unsharp" and as replacement "gimp_unsharp2" then click "Replace all"
Attachment:
replace.jpg [ 168.95 KiB | Viewed 5826 times ]
Now we must save the file in the same directory where is our gmic_def.xxxx file
and we MUST save the file with the name ".gmic" ( note the dot before the name ...here use Notepad+ instead then the Windows notepad is essential because the standard notepad will never allow you to save a file with a name starting with a dot, neither Win will allow you to rename a file by adding a dot before the name)
DONE !!
after all this fiddling here a little extra bonus
EXTRA BONUS
The first part of the code of a gmic filter is to create the graphic interface and set the Default,Min and Max value for each variable
In the case of our Unsharp mask the max value for Radios is limited to 40
But often, as in this case there is a upper limit only because required by the plugin architecture ,here limit was set to 40 because that seems a reasonable value (and it is in most cases a reasonable value)
BUt...Alas that limit make impossible use our Unsharp Mask for Local Contrast Enhancement that will require a radious of 100
...no problem we may change that raising the Max value to 100 as required for LCE so now the code will look as
Quote:
#@gimp Unsharp Mask 2 : gimp_unsharp2, gimp_unsharp2_preview(0)
#@gimp : Sharpening type = choice(0,"Gaussian","Bilateral")
#@gimp : Spatial radius = float(1.25,0,100)
#@gimp : Bilateral radius = float(30,0,100)
#@gimp : Amount = float(3,0,10)
#@gimp : Threshold = float(0,0,20)
#@gimp : Darkness level = float(1,0,4)
#@gimp : Lightness level = float(1,0,4)
#@gimp : Iterations = int(1,1,10)
#@gimp : Negative effect = bool(0)
#@gimp : Channel(s) = choice("All","RGBA","RGB","Luminance","Blue/red chrominances","Blue chrominance","Red chrominance","Lightness","ab-components","a-component","b-component","Hue","Saturation","Value","Key","Alpha","ch-components","c-component","h-component","Red","Green","Blue","Alpha")
#@gimp : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical")
#@gimp : note = note{"\n\n<small><b>Note : </b>
#@gimp : This filter is inspired by the original <i>Unsharp Mask</i> filter in GIMP, with additional parameters.
#@gimp : </small>"}
#@gimp : sep = separator(), note = note("<small>Author : <i>David Tschumperlé</i>. Latest update : <i>2010/12/29</i>.</small>")
gimp_unsharp2 :
-repeat @# -repeat $8
-if {$1==0} --blur[-1] $2 -else --bilateral[-1] $2,$3 -endif
--[-1] [-2] -*[-1] -$4
--norm[-1] -t[-1] $5% -r[-1] [-2] -*[-2,-1]
-if $9 -*[-1] -1 -endif
--c[-1] 0,100% -c[-2] -100%,0 -*[-2] $6 -*[-1] $7 -+[-2,-1]
-+[-2,-1] -c[-1] 0,255
-done -mv[-1] 0 -done
gimp_unsharp2 :
-apply_channels "-_gimp_unsharp2 $1,$2,$3,$4,$5,$6,$7,$8,$9",$10,0
gimp_unsharp2_preview :
-gimp_split_preview "-gimp_unsharp2 ${1--2}",$-1
that will not conflict with the older.
Note that is not always possible change the max value:
anyway most of the filter of the gmic plugin are based on corresponding command (same name except will start with #@gmic instead than #@gimp ) for the command line that are included in the same gmic_def.xxxx file,
if the corresponding native command has as limit ">0" ( more than 0 ) then the Max value may be raised if needed