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?
Announcement
Collapse
No announcement yet.
Automated Color Replacement
Collapse
X
-
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.
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)
- Likes 1
-
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
-
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.
- Likes 1
Comment
-
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
-
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.
Last edited by IrfanUserGuyxyx; 18.11.2022, 12:33 AM.
Comment
Comment