these scripts help with scripting with applying Color Curves Presets (saved settings).
it works with the "~\\.gimp-2.8\\tool-options\\gimp-curves-tool.settings" file under windows.
You might have to add environment variables HOME to point to your user's home directory.
(I say might because i did that yesterday and it worked, but then today it's gone i can't find the HOME environment variable but it still works for me I read somewhere that this is needed for the scripts to expand the ~ and find your home directory.)Okay here are the scripts:
1. python "get_color_curves_presets_names.py" intended for scheme script-fu to get a comma separated string of all the presets names
Attachment:
available under <Image>/Presets/Color Curves/Get Color Curves Preset Names (which does nothing when you run it from GIMP because its intended to be called by scheme script fu)
2. python "apply_color_curves_preset.py" will intended for both python-fu and scheme script-fu to call to apply a preset color curve. If you want to allow user to choose from list of preset names just copy the function called local_get_color_curves_presets_names() from this file into your own python-fu script. And then you can set up a PF_OPTION that uses this function to set up the list of preset names.
(for some reason when i tried to call the script 1 from above i kept getting some weird error on initialization at GIMP start-up)version 1: (only works with smooth curves, fails with freehanded curves)Attachment:
apply_color_curves_preset.zip [1.71 KiB]
Downloaded 263 times
version 2: (works with smooth curves as well as freehanded curves)apply_color_curves_preset(2).zipavailable under <Image>/Presets/Color Curves/Apply Color Curves Preset... (will apply color curve after letting user choose a preset name)
3. sample scheme script-fu file that uses the above python-fu scripts
Attachment:
test_tintran.scm [1.33 KiB]
Downloaded 266 times
available under <Image>/Presets/Color Curves/Script-Fu Test (will apply color curve after letting user choose a preset name)
All these 3 scripts register under <Image>/Presets/Color Curves/ (move it around as you see fit).
If you execute script 2 (python-fu) above it lets you choose from a list of preset names that are present at that time. So if you add a preset color curve, and run it again, the list will update with the new preset.
This doesn't happen for script 3 (scheme script-fu). If you add a preset color curve, you'll have to refresh scripts for script-fu to get that updated list (I haven't figured how or if there's even a way to make it update on its own).