It is currently Sat Jun 20, 2026 4:41 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: G'MIC-Qt CLI (Windows) - help
PostPosted: Thu May 22, 2025 1:00 pm  (#1) 
Offline
New Member

Joined: May 22, 2025
Posts: 2
Welcome,
it's my first post here, therefore apologize if it's not the right place.

I'm using GIMP 3.0.2 (version 1) with Q'MIC-Qt (3.5.4) for photo adjustments. Recently, I made around 700, and unfortunately each need to be corrected by Auto-Balance function. Doing this manually it's nightmare, therefore I need help, to create a script which I may run in Win11, and will correct all photos inside folder. All photos are jpg. I tried using ChatGPT to generate script code, but without success.

Input directory: C:\Birthday\*.jpg
Output directory: C:\Birthday\Adjusted\*.jpg
Q'MIC settings: Attached screenshot (I would like to apply for all photos)

Can someone help me?



Appreciate your support.


Attachments:
Q'MIC_settings.jpg
Q'MIC_settings.jpg [ 67.27 KiB | Viewed 4226 times ]
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: G'MIC-Qt CLI (Windows) - help
PostPosted: Thu May 22, 2025 5:49 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Nov 04, 2015
Posts: 1449
I can do this easily by using the G'MIC cli version, Linux and a batch file. :)


Top
 Post subject: Re: G'MIC-Qt CLI (Windows) - help
PostPosted: Fri May 23, 2025 1:11 am  (#3) 
Offline
New Member

Joined: May 22, 2025
Posts: 2
Wow, super. That will save my hours of work. I'll try to run live distro, and the script.
May you help and share it, and if it's not an problem some details about it.

Thanks in advance.


Top
 Post subject: Re: G'MIC-Qt CLI (Windows) - help
PostPosted: Fri May 23, 2025 1:58 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2639
Location: Poland
How to apply gmic CLI in Windows.
https://discuss.pixls.us/t/how-to-apply-gmic-cli/48838

_________________
Image


Top
 Post subject: Re: G'MIC-Qt CLI (Windows) - help
PostPosted: Fri May 23, 2025 5:26 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Nov 04, 2015
Posts: 1449
I made a turorial for this in 2020.

Simplified the steps are to locate the G'MIC command you want to use, insert it into a batch script, open a terminal in the folder where the images are and run the batch scrip. I use it on 1,000 or more frames generated by 3d fractal software.

Look for the G'MIC command that looks like this:
[gmic_gimp_qt]./apply/ v 3 gcd_anti_alias 60,0.3,50,"0"


This is the batch script:
#!/bin/bash
mkdir ./done
for i in *png
do
gmic $i v 3 gcd_anti_alias 60,0.3,50,0 -o ./done/$i
done 


This script is an insight into many computer processes.
It invokes a shell (bourne again shell in this case).
It applies the command to all PNGs or JPGs with the * wildcard.
It applies the G'MIC command sequentially so I get the numbering right first. (by opening them in Gimp and exporting with ofnuts export all layers)
It makes a new directory in the directory called 'done' where your images are.
The script like all Gimp scripts has to be made executable and in Unix it's started like this:
./GMIC_AntialiasDefaultSettingsV3.sh
'./' means the script is in the same folder as the images.

I use this method on videos like this one.


Top
 Post subject: Re: G'MIC-Qt CLI (Windows) - help
PostPosted: Fri May 23, 2025 10:29 am  (#6) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2603
Quote:
="debiecm"
Appreciate your support.


Well,maybe someone can sort this out.

I use a Gimp 3 script-fu as a "shell" for simple linear commands. For gmic auto-levels it looks like this.

   (script-fu-register
        "script-fu-auto"  ;func name
        "auto "    ;menu label
        " "    ;description
        " "    ;author
        " "    ;copyright notice
        " "    ;date created
        "*"    ;image type that the script works on
        SF-IMAGE    "Image"                 0
        SF-DRAWABLE "Drawable"              0
    )
    (script-fu-menu-register "script-fu-auto" "<Image>/Tools")
    (define (script-fu-auto image drawable)

        ;start
        (gimp-context-push)
        (gimp-image-undo-group-start image)

        ;put your procedures here

    (plug-in-gmic-qt 1 image (vector drawable) 1 0 "gcd_auto_balance 30,0,0,1,0")

        ;finish
        (gimp-image-undo-group-end image)
        (gimp-context-pop)
        (gimp-displays-flush)
    )


Now that works fine on a single image, used from the Tools menu.

However, using the only Gimp 3 batch plugin around at the moment, batcher, see: viewtopic.php?f=33&t=21588

That works fine on jpeg images, but desaturates png images. Very strange.

Using a Win11 / Gimp 2.0.4 oops 3.0.4 VM so could someone try and see ;)


Top
 Post subject: Re: G'MIC-Qt CLI (Windows) - help
PostPosted: Fri May 23, 2025 5:37 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Nov 04, 2015
Posts: 1449
Quote:
That works fine on jpeg images, but desaturates png images. Very strange


You could use G'MIC-Qt Input layers -'All' to apply a filter to a group of layers to see what's happening.

The OP could 'save' the G'MIC settings using 'Add Fave' and then apply that fave (essentially their own filter) to groups of images. I realized opening a thousand images is not possible for many computers. You need a lot of ram :)
That's why I started doing multi images this way. You can also use GEGL for this method.


Top
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group