I am trying to process hundreds of images in the same way and export them automatically one by one. Right now, I only have the image processing code for one image, and I want to learn what is the most efficient way to repeat the procedure for the rest of the hundreds of images.
My code for one image is:
Export["C:\\Users\\ProcessedImage1.tiff",ColorNegate[ImageFilter[Max,ColorSeparate[ImageApply[{Sin[Pi#*4],Sin[Pi#],Sin[Pi#*3]}&,Import["C:\\Users\\Image1.tiff"]],"L"],1]]//Colorize]
Right now, I can import several the images (very large file size) to a Table and export them one by one again using Table. However, it is very slow. How do I import one image, process it, export it then delete it from Mathematica's memory and move on to the next image? I am thinking For loop, Table, or Map, but I am not familiar with the language yet. In other words, how do I import "ImageX.tiff", where X is the number in my file name, then process it and export to "ProcessedImageX.tiff"?
TableandTemplateApply? In particular I think you'll want to useTable[expr,{i,number_of_images}]andTemplateApply["C:\\...Image``",i]insideexpr. – b3m2a1 Mar 17 '17 at 04:23ImageFileApplyandImageFileFilter? – Alexey Popkov Mar 17 '17 at 07:03Parallelizecan be helpful here. – Alexey Popkov Mar 17 '17 at 07:07Monitor[Do[processImage[file], {file, FileNames[folder]}], file]. WhereprocessImageis the function that does the actual processing. TheMonitoris just so I can see some progress – Niki Estner Mar 17 '17 at 07:45