# Image processing - editing and saving multiple images [closed]

How can I apply a particular image function (such as ImageTrim) to an entire folder of images and then save/export those edited (trimmed) images to a new folder?

## closed as off-topic by Alexey Popkov, Wjx, glS, gwr, m_goldbergMar 26 '17 at 15:56

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Alexey Popkov, Wjx, glS, gwr, m_goldberg
If this question can be reworded to fit the rules in the help center, please edit the question.

• What have you tried? This seems fairly straightfoward. Iterate with Do or Scan, use Import/Export, and look up the file name manipulation functions. for constructing the new file name from the old one. When everything is working, parallelize with ParallelDo. – Szabolcs Mar 23 '17 at 21:01
• Thank you! will try that. Cheers – Sunny Mar 23 '17 at 21:51

You may try like this: for version: 11.1

   path = "C:\\Users\\sunny";
SetDirectory[path]
files = FileNames[]


   im = Import["ExampleData/spikey.tiff"]


   files = {im, im, im, im};


then image trim entire folder of images:

 img=ImageTrim[files[[#]], {{30, 30}, {90, 90}}] & /@ Range[Length[files]]


Export files to folder named trim:

   Export["C:\\Users\\sunny\\Desktop\\trim\\" <> "new_" <> ToString[#] <>
".png", img[[#]]] & /@ Range[Length@files]