Gimp-Forum.net
Re: batch processing on bulk layer - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: Re: batch processing on bulk layer (/Thread-Re-batch-processing-on-bulk-layer)

Pages: 1 2


Re: batch processing on bulk layer - Stephen Liu - 06-10-2022

Hi all,

I expect performing bulk/batch editing a group of negative-images (say for example 40 negative-images) running following commands on GIMP
Colors -> Auto -> White Balance
and then
Colors -> Linear Invert

A folk on another thread advised me to do it through layer;
1. Create a new layer
2. Copy 40 negative-images on new layer
3. Perform editing one negative-image, then the rest negative-images would be automatically edited simultaneously.

I have 2 GIMP versions:-
GIMP 2.10.18
Ubuntu 20.04 desktop
G'MIC-Qt (Filter plugin)
Goat-Exercise

GIMP 2.10.30
Ubuntu 22.04 desktop VM (VirtualBox)
Python-Fu (Filter plugin)
Scipt-Fu

I have no previous experience on this technique and on making some search online I found following threads;

Bulk layer edits with GIMP
https://astroroad.com.au/processing/bulk-layer-edits-with-gimp/

GIMP batch processing
https://www.educba.com/gimp-batch-processing/

GIMP Batch Mode (it needs a script)
https://www.gimp.org/tutorials/Basic_Batch/

HOW TO BATCH EDIT PHOTOS USING GIMP AND BIMP (+ HOW TO INSTALL)
https://daviesmediadesign.com/project/how-to-batch-edit-photos-using-gimp-and-bimp-how-to-install/

BIMP. Batch Image Manipulation Plugin for GIMP.
Addicted to GIMP?
https://alessandrofrancesconi.it/projects/bimp/
BIMP 2.6 (download from source)
https://github.com/alessandrofrancesconi/gimp-plugin-bimp/releases/tag/v2.6

Please advise which document/thread shall I follow?

Thanks

Regards


RE: Re: batch processing on bulk layer - PixLab - 06-10-2022

If all in layers, I would use Filters ➤ G'MIC ➤ Colors ➤ Auto balance(there are other filters in G'MIC), then as "Input Layer" ➤ All, then use one of the Ofnut's script to export each layer as image


RE: Re: batch processing on bulk layer - Stephen Liu - 06-10-2022

(06-10-2022, 05:11 AM)PixLab Wrote: If all in layers, I would use Filters ➤ G'MIC ➤ Colors ➤ Auto balance(there are other filters in G'MIC), then as "Input Layer" ➤ All, then use one of the Ofnut's script to export each layer as image
Thanks for your advice.

How to create the new layer ?
Layer -> New Layer  (no response)
Layer -> New from Visible
Layer -> New Layer Group

Which of them shall I select ?

Whether after having created a new layer, copy all negative-images on it with "Drag & Drop".  Afterwards execute the commands ?

Please advise.  Thanks

Regards


RE: Re: batch processing on bulk layer - rich2005 - 06-10-2022

Quote: I expect performing bulk/batch editing a group of negative-images (say for example 40 negative-images) running following commands on GIMP
Colors -> Auto -> White Balance
and then
Colors -> Linear Invert

A folk on another thread advised me to do it through layer;
1. Create a new layer
2. Copy 40 negative-images on new layer
3. Perform editing one negative-image, then the rest negative-images would be automatically edited simultaneously.

I do wish 'folk' would try out advice before giving it.

When it comes to Colors -> Auto -> White Balance Each Image is assessed individually. Even a border will make a difference. It is very unlikely that 40 combined images will process correctly. Applying Auto White Balance to your two negatives one with white BG the other with black BG. Neither correct. https://i.imgur.com/gE7UYV5.jpg


RE: Re: batch processing on bulk layer - sallyanne - 06-12-2022

Sorry to mislead you, you cannot use any of the colour menu items that you need once they are in a group.


RE: Re: batch processing on bulk layer - Stephen Liu - 06-12-2022

(06-12-2022, 06:59 AM)sallyanne Wrote: Sorry to mislead you, you cannot use any of the colour menu items that you need once they are in a group.
Hi,

Never mind.  We are here helping each others.  That was your good intent.

Regards

Hi all,

Is there anyway to run batch process on GIMP alone, without plugin, such as BIMP, G'MIC etc ?

Thanks

Regards


RE: Re: batch processing on bulk layer - rich2005 - 06-12-2022

Quote:Is there anyway to run batch process on GIMP alone, without plugin, such as BIMP, G'MIC etc ?

Of course it is possible.

You have already referenced https://www.gimp.org/tutorials/Basic_Batch/ more that once. That is using script-fu to create a script. An alternative is you to create a python plugin and this method comes originally from an Ofnuts post. https://ntcore.com/?p=509

The bottom line. Can you write either script-fu or python ?

You can't ? then use BIMP and G'mic


RE: Re: batch processing on bulk layer - Stephen Liu - 06-12-2022

(06-12-2022, 12:50 PM)rich2005 Wrote:
Quote:Is there anyway to run batch process on GIMP alone, without plugin, such as BIMP, G'MIC etc ?

Of course it is possible.

You have already referenced https://www.gimp.org/tutorials/Basic_Batch/ more that once. That is using script-fu to create a script. An alternative is you to create a python plugin and this method comes originally from an Ofnuts post. https://ntcore.com/?p=509

The bottom line. Can you write either script-fu or python ?

You can't ? then use BIMP and G'mic
No.  But I'm willing to learn something new to me.

I would forget python because unable to run it on Ubuntu 20.04

Whether following documents suffice for me learning script-fu?
Chapter 11.  Scripting the GIMP
http://uneex.ru/static/GimpDoc_EnRu/en/gimp-scripting.html

In particular;
2.6. Image-Dependent Scripts
https://docs.gimp.org/2.10/en/image-independent-script-fu.html

Re
GIMP Batch Mode
https://www.gimp.org/tutorials/Basic_Batch/

and
Batch image manipulation using Python and GIMP
https://ntcore.com/?p=509

Also I'm prepared to learn.  Does it need python?

If for example on GIMP
Colors -> Auto > White Balance
and then
Colors -> Linear Invert

What is GIMP Batch Mode ?
$ gimp ....

Thanks

Regards


RE: Re: batch processing on bulk layer - rich2005 - 06-12-2022

You have quoted this https://www.gimp.org/tutorials/Basic_Batch/ four  times Have you actually studied it ? It will not make you a scripting wizard but might get you started. Use it as a template.

[attachment=8097]

...and you can get a simple script-fu

Code:
  (define (photonegative pattern)
  
  (let* ((filelist (cadr (file-glob pattern 1))))
    (while (not (null? filelist))
           (let* ((filename (car filelist))
                  (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
                  (drawable (car (gimp-image-get-active-layer image))))

             (gimp-drawable-levels-stretch drawable)
             (gimp-drawable-invert drawable TRUE)
             
             (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
             (gimp-image-delete image))
           (set! filelist (cdr filelist)))))
           

Can you see the similarities ? One gimp procedure replaced by the two you require.

The information on using it is there as well. It tells you to run a command in the folder containing the images.
In a terminal
Code:
gimp -i -b '(photonegative  "*.jpeg" )' -b '(gimp-quit 0)'

...and that will apply the auto white balance and the invert-linear

example: https://i.imgur.com/TxXVJUs.mp4

...but if you want to do more than that, color corrections, then the commands you want are GEGL and not (easily) scriptable

Do not want to use BIMP ? I can have your 999 negatives processed before you have finished copying the script into your Gimp scripts folder.


RE: Re: batch processing on bulk layer - Stephen Liu - 06-13-2022

(06-12-2022, 06:20 PM)rich2005 Wrote: You have quoted this https://www.gimp.org/tutorials/Basic_Batch/  four  times Have you actually studied it ? It will not make you a scripting wizard but might get you started. Use it as a template.



...and you can get a simple script-fu

Code:
  (define (photonegative pattern)
  
  (let* ((filelist (cadr (file-glob pattern 1))))
    (while (not (null? filelist))
           (let* ((filename (car filelist))
                  (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
                  (drawable (car (gimp-image-get-active-layer image))))

             (gimp-drawable-levels-stretch drawable)
             (gimp-drawable-invert drawable TRUE)
             
             (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
             (gimp-image-delete image))
           (set! filelist (cdr filelist)))))
           

Can you see the similarities ? One gimp procedure replaced by the two you require.

The information on using it is there as well. It tells you to run a command in the folder containing the images.
In a terminal
Code:
gimp -i -b '(photonegative  "*.jpeg" )' -b '(gimp-quit 0)'

...and that will apply the auto white balance and the invert-linear

example: https://i.imgur.com/TxXVJUs.mp4

...but if you want to do more than that, color corrections, then the commands you want are GEGL and not (easily) scriptable

Do not want to use BIMP ? I can have your 999 negatives processed before you have finished copying the script into your Gimp scripts folder.
Thanks for your advice.

Sorry.  It is difficult for me tracing data in another thread.

Now I have changed my decision, scanning past photos on smartphoto instead of their film negatives.  It'll save me lot of time. The quality of the digital photos is quite good.  No post-editing is required.  Please refers to attached photos captured by me in the past in Linz, Austria, no macros, only 1x1

The fixture is very simple.  The plastic clips are for indexing. Please refers to attached photo

Cropping can't be avoided.  Should I find those digital photos are of inferior quality then I'll scan their negatives.

Regards

Hi all,

I'm running remote desktop to shoot photos remotely.

My smartphone, Samsung Galaxy S9+, is connected to Ubuntu 20.04 desktop PC via an USB cable. It will charge the smartphone during capturing simultaneously.

I just remote-control the smartphone on Ubuntu 20.04 display and keyboard. After capturing, the digital file is immediately download to PC without saving on the smartphone.

This arrangement is very efficient without creating un-necessary motion to the smartphone during capturing because I don't need touching the screen of the smartphone.

Regards