@Nicolas Welcome to the forum and thanks for sharing. I know there are some multiscale CLAHE papers out there. Maybe you could consider, experiment with and implement some of their findings.
I have been using CLAHE in medical imagery thanks to its ability to “reveal” potential bad stuff. I did not know that it could be also interesting in digital photography… TIL
For the curious folks, here is my implementation (with plenty of room for improvements and some limitations)
Thank you. It is working in GIMP 3.2.Windows. Installing NumPy was a bit tricky. But with instructions from chatGPT, I managed to do it. Thank you.
There might be some room for an additional feature: namely running CLAHE separately for each color channel. This way, you can also perform color correction at the same time.
To be perfectly honest, I’m a little put off by the fact that you have to install NumPy and Python (which together easily weigh in at 200 Mb) just to get a local histogram equalization filter in GIMP. We’re really in the era of software bloat…
Having gotten my start in computer science by creating like 4KB demos on the Amstrad CPC in Z80 assembly language, I have to admit that it still strikes me as odd to see the monstrosities (in terms of size) resulting from the use of Python nowadays.
I have been very impressed by your program. However, unfortunately, installing numpy into the GIMP - Python environment is very difficult and your instruction for it does not seem effective in most cases. I suppose that you use self-build GIMP.
Therefore I have arranged your program.
This program runs using a Python virtual environment numpy installed. I have separated your program into the main process which does not use numpy and some subprocesses using another python interpreter and numpy in the virtual environment. When numpy processing is needed, the main process calls the subprocess and receives the results from them through shared memories.
Also I have internationalized it.
To use this program, users need to make the Python virtual environment numpy installed first. It is recommended to make it under the GIMP user setting directory, like $HOME/.config/GIMP/3.2 or $HOME\appData\roaming\GIMP\3.2 (in Windows) etc.
Next, users edit config.ini in the plug-in’s directory according to your virtual environment.
For example if you made it as $HOME/.config/GIMP/3.2/.venv you set the parameters in config.ini as follows.
[Python installed Directory in venv]
DIRPY;$GIMPDIR/.venv/bin
$GIMPDIR is a proxy keyword to indicate your GIMP setting directory path like $HOME/.config/GIMP/3.2.
This program is usable in Linux, Windows and Mac OS, however in Mac OS, the usable GIMP version is 3.2.4 or under. From 3.2.6, GIMP in Mac OS seems to inhibit the Pyhton plug-ins to call outer python scripts in the virtual environment as subprocess, for which I don’t know the reasons.