Gimp-Forum.net
Batch processing of photos on post-editing - 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: Batch processing of photos on post-editing (/Thread-Batch-processing-of-photos-on-post-editing)

Pages: 1 2


Batch processing of photos on post-editing - Stephen Liu - 05-23-2022

GIMP 2.10.18 on Ubuntu 20.04 desktop



Hi all,

I have hundreds of film negatives to be converted to digitized files.  I have no problem scanning them and saving them on Smartphone (with/without scan software installed) to negative photos.  After downloading them to computer I run following "mogrify" command lines (ImageMagick command) batch converting them to postive photos.
Code:
$ mogrify -negate *.* (convert negative photos to postive)

$ mogrify -negate -rotate 90 *.* (convert negative photos to postive and rotate 90 deg clockwise)

$ mogrify -negate -rotate -90 *.* (convert negative photos to postive and rotate 90 deg counter-clockwise)

$ mogrify -negate -rotate 180 *.* (convert negative photos to postive and rotate 180 deg)
They work for me seamlessly.  

Regarding Brightness, Contrast, Hue, Color etc. Can they be processed in batch?

ImageMagicks command;
Code:
$ morgify/convert -brightness-contrast 12x34 *.*
12x13 (value of -brightness-contrast, for example)
able to batch converting all photos but there is no preview.

I found BIMP/DBP plugins for GIMP.  They can perform batch process.  

Is there preview provided?
Can they perform batch processing on HUE Color, brightness, contrast, saturation etc. ?

It would be a tedious work to post-editing hundreds of photo, one by one.

OR is there a better solution for me?  Please advise.

Thanks in advance

Regards
SL


RE: Batch processing of photos on post-editing - rich2005 - 05-23-2022

Quote:..Is there preview provided?
Can they perform batch processing on HUE Color, brightness, contrast, saturation etc. ?

Second part first. Many of the Gimp 2.10 colour filters are now GEGL based and not normally available to BIMP (forget DBP, it is ancient and BIMP is better) The GEGL filters can be wrapped up in a python 'wrapper' and become available to BIMP but it is a pita.

Easier ways are adjusting the colour curve, export the settings to a curve file and use that in BIMP - The color correction section. Another way is using the Gimp g'mic-qt plugin which has many colour tweaking filters and these can be used with BIMP.

Then ..Is there a preview provided ? No. Only for the typical image used to establish the settings. By definition a batch process adjusts a group of files without user intervention.

You would need to cycle through a folder of images individually, adjusting each to suit. There is a plugin that helps with that ofn-file-next.zip dated 2020-05-03 from: http://sourceforge.net/projects/gimp-tools/files/scripts/


RE: Batch processing of photos on post-editing - Ofnuts - 05-23-2022

(05-23-2022, 05:15 AM)Stephen Liu Wrote: GIMP 2.10.18 on Ubuntu 20.04 desktop



Hi all,

I have hundreds of film negatives to be converted to digitized files.  I have no problem scanning them and saving them on Smartphone (with/without scan software installed) to negative photos.  After downloading them to computer I run following "mogrify" command lines (ImageMagick command) batch converting them to postive photos.
Code:
$ mogrify -negate *.* (convert negative photos to postive)

$ mogrify -negate -rotate 90 *.* (convert negative photos to postive and rotate 90 deg clockwise)

$ mogrify -negate -rotate -90 *.* (convert negative photos to postive and rotate 90 deg counter-clockwise)

$ mogrify -negate -rotate 180 *.* (convert negative photos to postive and rotate 180 deg)
They work for me seamlessly.  

Regarding Brightness, Contrast, Hue, Color etc. Can they be processed in batch?

ImageMagicks command;
Code:
$ morgify/convert -brightness-contrast 12x34 *.*
12x13 (value of -brightness-contrast, for example)
able to batch converting all photos but there is no preview.

I found BIMP/DBP plugins for GIMP.  They can perform batch process.  

Is there preview provided?
Can they perform batch processing on HUE Color, brightness, contrast, saturation etc. ?

It would be a tedious work to post-editing hundreds of photo, one by one.

OR is there a better solution for me?  Please advise.

Thanks in advance

Regards
SL

Another way to do that with IM is to create  a batch that uses convert several times on the same source image with varying parameters to produce several outcomes of the same image, and pick the IM parameters of the one that looks the best for use on all other images.


RE: Batch processing of photos on post-editing - Stephen Liu - 05-23-2022

(05-23-2022, 07:42 AM)Ofnuts Wrote:
(05-23-2022, 05:15 AM)Stephen Liu Wrote: GIMP 2.10.18 on Ubuntu 20.04 desktop



Hi all,

I have hundreds of film negatives to be converted to digitized files.  I have no problem scanning them and saving them on Smartphone (with/without scan software installed) to negative photos.  After downloading them to computer I run following "mogrify" command lines (ImageMagick command) batch converting them to postive photos.
Code:
$ mogrify -negate *.* (convert negative photos to postive)

$ mogrify -negate -rotate 90 *.* (convert negative photos to postive and rotate 90 deg clockwise)

$ mogrify -negate -rotate -90 *.* (convert negative photos to postive and rotate 90 deg counter-clockwise)

$ mogrify -negate -rotate 180 *.* (convert negative photos to postive and rotate 180 deg)
They work for me seamlessly.  

Regarding Brightness, Contrast, Hue, Color etc. Can they be processed in batch?

ImageMagicks command;
Code:
$ morgify/convert -brightness-contrast 12x34 *.*
12x13 (value of -brightness-contrast, for example)
able to batch converting all photos but there is no preview.

I found BIMP/DBP plugins for GIMP.  They can perform batch process.  

Is there preview provided?
Can they perform batch processing on HUE Color, brightness, contrast, saturation etc. ?

It would be a tedious work to post-editing hundreds of photo, one by one.

OR is there a better solution for me?  Please advise.

Thanks in advance

Regards
SL

Another way to do that with IM is to create  a batch that uses convert several times on the same source image with varying parameters to produce several outcomes of the same image, and pick the IM parameters of the one that looks the best for use on all other images.
Hi,

Thanks for your advice

Before posting I have performed followin test;

On Terminal ran;
$ morgify/convert -brightness-contrast 12x34 *.*
with different sets of values
For example: 56/78, 90/12 etc.

The command lines worked seamlessly. But I have to view all hundred photo with Image Viewer, one by one, to select the photos which are up to my satisfaction.  There is no preview.

How to batch process, running IM commands, to edit HUE, Color, Sharpnesse etc.  I have no idea.  Besides, there is no preview.

Regards
SL

(05-23-2022, 07:31 AM)rich2005 Wrote:
Quote:..Is there preview provided?
Can they perform batch processing on HUE Color, brightness, contrast, saturation etc. ?

Second part first. Many of the Gimp 2.10 colour filters are now GEGL based and not normally available to BIMP (forget DBP, it is ancient and BIMP is better) The GEGL filters can be wrapped up in a python 'wrapper' and become available to BIMP but it is a pita.

Easier ways are adjusting the colour curve, export the settings to a curve file and use that in BIMP - The color correction section. Another way is using the Gimp g'mic-qt plugin which has many colour tweaking filters and these can be used with BIMP.
Your advice noted.  Thank.

I'll test BIMP later

Quote:Then ..Is there a preview provided ?  No. Only for the typical image used to establish the settings. By definition a batch process adjusts a group of files without user intervention.
It is NOT convenient, running "Image Viewer" checking hundred photos.

Quote:You would need to cycle through a folder of images individually, adjusting each to suit.  There is a plugin that helps with that  ofn-file-next.zip dated 2020-05-03  from: http://sourceforge.net/projects/gimp-tools/files/scripts/
Thanks.  I'll check it later.

There are other Open Source command-line graphic tools for Linux, such as;

GraphicsMagick Image Processing System
http://www.graphicsmagick.org/
Scrot
https://github.com/dreamer/scrot
Feh
https://feh.finalrewind.org/
Exiv2
https://exiv2.org/

Do you have experience running them?

Regards
SL


RE: Batch processing of photos on post-editing - Stephen Liu - 05-23-2022

Hi all,

Further to my previous posting:

Also I have performed the test below

Step-1
Select a positive photo and open it on GIMP

Step-2
adjust brightness and contrast
-> Colors -> Brightness-Contrast

Find a set of their values. The brightness and contrast of the photo are satisfy to me.
Example: brightness 23 and contrast 56

Step-3
Run following IM command on Terminal;
Code:
$ mogrify -brightness-contrast 23x56 *.*

The command works seamlessly but the brightness and contrast look completely different viewed on Image Views. I don't know why?

I have to adjust their values blindlessly.

Regards
SL


RE: Batch processing of photos on post-editing - rich2005 - 05-23-2022

Quote:There are other Open Source command-line graphic tools for Linux, such as;

GraphicsMagick Image Processing System http://www.graphicsmagick.org/
Scrot https://github.com/dreamer/scrot
Feh https://feh.finalrewind.org/
Exiv2 https://exiv2.org/
Do you have experience running them?


That is a real mixture, I can not remember which came first, I think GM before IM but they are forks of the same. You do not need both, stick with IM. Scrot I have used for capturing time-lapse frames the others ??? but if you are looking for a command line viewer then IM has the display function.

Quote:....but the brightness and contrast look completely different viewed on Image Views. I don't know why? ...I have to adjust their values blindlessly.

I think you are asking a graphics appliction to make decisions for you. Each negative is going to be different and need your attention, batch is for running through a list without intervention.

However as a starting point for *you* to improve on. Assuming all images are jpeg

Code:
#!/bin/bash
  find . -name "*.jpg" | while read fname ; do
     echo "Doing:  $fname"
     convert -negate -brightness-contrast 23x56 "$fname" temp.png
     display -resize 500x500 temp.png
     read -p "Press any key to continue... "
     echo "Press the space bar..."
     rm temp.png
     convert "$fname" -negate -brightness-contrast 23x56 "${fname%%jpg}png"
    
  done

Put that in the folder with your images and run it in a terminal so you can answer the "press any key..."

Using Ubuntu 20.04 and Gimp 2.10.18 ? Probably a stock Gimp that comes without python support so Ofnuts plugins are out. Gmic does provide a decent preview and filter values saved for future use, but it is a one-by-one plugin (unless used with bimp, back to the no-preview scenario)

best of luck...


RE: Batch processing of photos on post-editing - Stephen Liu - 05-23-2022

(05-23-2022, 10:01 AM)rich2005 Wrote:
Quote:There are other Open Source command-line graphic tools for Linux, such as;

GraphicsMagick Image Processing System   http://www.graphicsmagick.org/
Scrot  https://github.com/dreamer/scrot
Feh  https://feh.finalrewind.org/
Exiv2  https://exiv2.org/
Do you have experience running them?


That is a real mixture, I can not remember which came first, I think GM before IM but they are forks of the same. You do not need both, stick with IM. Scrot I have used for capturing time-lapse frames the others ??? but if you are looking for a command line viewer then IM has the display function.

Quote:....but the brightness and contrast look completely different viewed on Image Views. I don't know why? ...I have to adjust their values blindlessly.

I think you are asking a graphics appliction to make decisions for you. Each negative is going to be different and need your attention, batch is for running through a list without intervention.

However as a starting point for *you* to improve on. Assuming all images are jpeg
Noted and thanks. Yes, all are jpeg images. For other image formats I can convert them to jpeg

Quote:
Code:
#!/bin/bash
 find . -name "*.jpg" | while read fname ; do
    echo "Doing:  $fname"
    convert -negate -brightness-contrast 23x56 "$fname" temp.png
    display -resize 500x500 temp.png
    read -p "Press any key to continue... "
    echo "Press the space bar..."
    rm temp.png
    convert "$fname" -negate -brightness-contrast 23x56 "${fname%%jpg}png"
   
 done

Put that in the folder with your images and run it in a terminal so you can answer the "press any key..."
I'll test it later.  Thanks

Quote:Using Ubuntu 20.04 and Gimp 2.10.18 ?  Probably a stock Gimp that comes without python support so Ofnuts plugins are out. Gmic does provide a decent preview and filter values saved for future use, but it is a one-by-one plugin (unless used with bimp, back to the no-preview scenario)
Yes GIMP was installed on Ubuntu 20.04 repo.  Whether uninstall it and re-install it running;
Flatpad
Or
Snap
?

Performed further test as follow
Step-1
Scan a new film negative on Smartphone running "Photo Negative Scan"

Step-2
Continue on Smartphone, start Snapscan converting the negative photo to positive and filtering the positive photo

Step-3
Save the positive photo and download it to computer.

I think it would be better converting the scanned photo direct on Smartphone to positive photo and filter it there

Pls refer to attached photo

photo-1 convert to positive and filter on Smartphone
photo-2 convert to positive image on Terminal without filtering

Edit
===
Could you please suggest the steps of post-editing photo-1? Thanks

Regards


RE: Batch processing of photos on post-editing - rich2005 - 05-23-2022

Yeah, well, I have misgivings about smart phones. Mine is where it should be, turned off and on a shelf.

For what it is worth that script in action, not so good it is just an example: https://i.imgur.com/UT5BOoK.mp4 The little original negative image shown in viewnior viewer.


RE: Batch processing of photos on post-editing - PixLab - 05-23-2022

FWIW, when I have big batches processing, I use XnConvert, (xnconvert is also part of xnview) and xnconvert can be in your distro software center, if not > https://www.xnview.com/en/xnconvert/ , they have a .deb and a targz.
It has visualization, but if you change one setting it will apply to the thousands of picture or the whole directory you dropped in it..

For what is worth
[attachment=7955]


RE: Batch processing of photos on post-editing - Stephen Liu - 05-23-2022

(05-23-2022, 12:09 PM)rich2005 Wrote: Yeah, well, I have misgivings about smart phones. Mine is where it should be, turned off and on a shelf.

For what it is worth that script in action, not so good it is just an example: https://i.imgur.com/UT5BOoK.mp4  The little original negative image shown in viewnior viewer.
What I expect to know is how to enhance the quality of the positive image on GIMP? 

There are so many options HUE, Brightness, Color Balance, Color Temperature etc. What will be the steps?  Which of the option should be edited first?

Regards

(05-23-2022, 01:57 PM)PixLab Wrote: FWIW, when I have big batches processing, I use XnConvert, (xnconvert is also part of xnview) and xnconvert can be in your distro software center, if not > https://www.xnview.com/en/xnconvert/ , they have a .deb and a targz.
It has visualization, but if you change one setting it will apply to the thousands of picture or the whole directory you dropped in it..

For what is worth

Thanks for your advice.

XnConvert is NOT on Ubuntu 20.04 repo

$ apt-cache policy XnConvert
Code:
N: Unable to locate package XnConvert

I ran Flatpak to install it

Steps performed on Terminal;
Code:
$ sudo apt update
$ sudo apt install flatpak
$ flatpak install --user https://flathub.org/repo/appstream/com.xnview.XnConvert.flatpakref
$ flatpak --user update com.xnview.XnConvert
    
Start XnConvert
Code:
    
flatpak run com.xnview.XnConvert
Pls refer to attached screenshot.

Kindly advise where can find XnConvert Tutorial?  Thanks

Regards