Announcement

Collapse
No announcement yet.

Automated Color Replacement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Automated Color Replacement

    I am replacing 2 colors with white in a series of images to be generated over time. They are always the same 2 colors. Is there a way to automate this replacement, with a macro or a script?

    #2
    The batch conversion dialog offers a way to replace one color with another (File > Batch Conversion/Rename...). For two different colors you'll have to do it twice.
    Make some tests for the setting before you do it with your images.

    Click image for larger version  Name:	batch_re-color.jpg Views:	0 Size:	162,5 KB ID:	96297
    Last edited by Kuki Dent; 16.11.2022, 10:29 PM. Reason: Added menu dialog
    Win 10/64 Home 22H2 IrfanView 4.70/64
    Hate has caused a lot of problems in this world, but it has not solved one yet. (Maya Angelou)

    Comment


      #3
      Thank you for that. Batch is great when a large number of images have to be processed at once. In my case, images are generated over time, 2 or 3 a day, say, and would need to be processed right away. I was hoping to do that quickly, whereas batch setup seems to take some time, and processing 2 or 3 images by hand might be faster.

      Comment


        #4
        A given batch conversion can be done with a batch file. See:

        https://irfanview-forum.de/forum/pro...-file-explorer

        for 2-3 files a drag and drop batch file is probably appropriate.

        Comment


          #5
          By the way, in Advanced you can save and load specific settings.

          Click image for larger version

Name:	Capture_20221117-122116.jpg
Views:	239
Size:	145.3 KB
ID:	96304
          Attached Files

          Comment


            #6
            Thank you. I did save the 3 settings for my 3 operations, and can now apply them sequentially to my files, one operation after the other. I'm still looking at your batch command line, but from what I currently understand it's also sequential, that is I can't apply all 3 operations in one shot, could I?

            Comment


              #7
              Depends on what 3 operations. You can set all of the operations at once, unless you need to do one twice with different settings. I suppose if the order of operations is important, IV may do them in the wrong order, I would just try it.

              If you exit Irfanview after setting up the batch conversion and save "C:\Users\<your ptofile>\AppData\Roaming\IrfanView\i_view64.ini" to a new directory you can use the following command line to run it.

              "C:\Program Files\IrfanView\i_view64.exe" <your files> /ini="<that new directory with i_view64.ini>" /advancedbatch /convert=<output file name (use patterns - see IV help)>

              The forum post I referenced 4:65 pm has an example of using patterns in the /convert=<output file>


              I think if you use:

              "C:\Program Files\IrfanView\i_view64.exe" %* /ini="<that new directory with i_view64.ini>" /advancedbatch /convert=<output file name (use patterns)>

              you could drag and drop on the batch file to run it with a few images.

              Click image for larger version

Name:	Capture_20221117-193212.jpg
Views:	370
Size:	227.4 KB
ID:	96308
              Last edited by IrfanUserGuyxyx; 18.11.2022, 12:33 AM.

              Comment


                #8
                I'll play with all this. What I have now (sequentially loading batch settings and running batch with file overwrite) is already much faster than what I was doing before. Thanks again.

                Comment

                Working...
                X