What's the most efficient way to batch-import, batch-process and batch-export images?

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"?

• Have you read the documentation on Table and TemplateApply? In particular I think you'll want to use Table[expr,{i,number_of_images}] and TemplateApply["C:\\...Image",i] inside expr. – b3m2a1 Mar 17 '17 at 4:23
• Have you tried ImageFileApply and ImageFileFilter? – Alexey Popkov Mar 17 '17 at 7:03
• Also, Parallelize can be helpful here. – Alexey Popkov Mar 17 '17 at 7:07
• I usually use some variant of Monitor[Do[processImage[file], {file, FileNames[folder]}], file]. Where processImage is the function that does the actual processing. The Monitor is just so I can see some progress – Niki Estner Mar 17 '17 at 7:45
• Hi nikie, when I use Monitor[Do[processImage[file], {file, FileNames[folder]}], file], according to your suggestion, the error message is "C:\.." not an array or an image. So instead of using FileNames[folder], I tried using Import[folder] to import my images. However, my processImage function does not work even though I got the images to show.. I just want to use a simple StandardDeviationFilter to filter all the images in this folder. Any other suggestions? Thank you! – Chelsea Mar 23 '17 at 21:59
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3138355016708374, "perplexity": 1169.450655425026}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-35/segments/1566027316785.68/warc/CC-MAIN-20190822064205-20190822090205-00421.warc.gz"}