Hi Ehud,
Writing a function is the best way to do that. Something like
meanGrayPlot[imageFileName_String] :=
Import[imageFileName] // ColorConvert[#, "Grayscale"] & // RemoveAlphaChannel //
ImageData // Mean //
ListPlot[#, PlotLabel -> FileNameTake[imageFileName], ImageSize -> 300] &
Then map it over a list of filenames. I ran it on a directory with some PNG images I had. Change *.png
to *.tif
and dir
to the name of the directory with your images.
FileNames["*.png", dir] // Map[meanGrayPlot] //
Partition[#, UpTo[3]] & // Grid[#, Frame -> All] & //
Labeled[#, "Mean Graylevel Plots", Top] &