To cut the memory usage to half, in this case you can set the $HistoryLength to 0 which forces Mathematica to not keep copies of the data in the Out list.

For increasing the Import speed, you can save all the images in a multipage tiff file and then import them at once which is a lot faster.

$HistoryLength = 0

You may also use the ParallelMap[] function which uses multiple cores (depending on your license) and is usually faster :

Impimg = ParallelMap[Import[#] &, FileNames["*.bmp"]];

Answer from MostafaMV on Stack Overflow
🌐
Wolfram Documentation
reference.wolfram.com › language › howto › ImportAndExportImages.html
Import and Export Images - Wolfram Language Documentation
Use the Insert ▶ File Path menu item or type a file path to import a local image file as an image object.
🌐
Wolfram Language
reference.wolfram.com › language › guide › CreatingAndImportingImages.html
Creating & Importing Images—Wolfram Documentation
Copy, Drag/Drop — copy and paste an image directly into a notebook · Import — programmatically import any standard format (TIFF, PNG, JPEG, DICOM, ...)
🌐
Wolfram Documentation
reference.wolfram.com › language › workflow › ImportAnImageIntoANotebook.html
Import an Image into a Notebook—Wolfram Documentation
See comments in the Notes section following for what to do if dropping an image into a notebook results in text rather than an image.
🌐
Wolfram Documentation
reference.wolfram.com › language › howto › GetAnImageIntoTheWolframSystem.html
Get an Image into the Wolfram System—Wolfram Documentation
If you know the file path of the image on your computer, you can use Import to get the image into the Wolfram System:
🌐
Wolfram Community
community.wolfram.com › groups › - › m › t › 1424317
Import a lot of images with Mathematica? - Online Technical Discussion Groups—Wolfram Community
Wolfram Community forum discussion about Import a lot of images with Mathematica?. Stay on top of important topics and build connections by joining Wolfram Community groups relevant to your interests.
🌐
Wolfram
wolfram.com › mathematica › new-in-10 › enhanced-image-processing › import-large-images.html
Import Large Images: New in Mathematica 10 - Wolfram
New in Mathematica 10 › Enhanced Image Processing › · ‹ · Large images, especially the ones that do not fit in the memory, can be directly imported as a thumbnail. Also, while the classic TIFF file format has a limit of storing up to 4GB of data, BigTIFF is designed to extend this limitation.
Find elsewhere
🌐
Wolfram
wolfram.com › mathematica › new-in-10 › enhanced-image-processing › import-raw-images-using-a-c-library.html
Import Raw Images Using a C Library: New in Mathematica 10
EXTERN_C DLLEXPORT int read_raw_image(WolframLibraryData libData, mint Argc, MArgument *Args, MArgument res) { ... WolframImageLibrary_Functions imgFuns = libData->imageLibraryFunctions; ... file = MArgument_getUTF8String(Args[0]); libraw_open_file(iprc, file); libraw_unpack(iprc); iprc->params.output_bps = 8; ... img = libraw_dcraw_make_mem_image(iprc, &check); ... if (img->bits == 16) { raw_t_ubit16 * raw_data = (raw_t_ubit16*)img->data; imgFuns->MImage_new2D( img->width, img->height, 3, MImage_Type_Bit16, MImage_CS_RGB, 1, &out); memcpy(imgFuns->MImage_getBit16Data(out), raw_data, img->width * img->height * 3 * sizeof(raw_t_ubit16)); } else { ... } MArgument_setMImage(res, out); ... } Load the function and use it to import a raw file.
🌐
Notebookarchive
notebookarchive.org › how-do-i-do-basic-image-processing-in-mathematica--2018-10-10r8f3h
How Do I Do Basic Image Processing in Mathematica? | The Notebook Archive
The Import command provides Mathematica users with an efficient and intuitive way to read files in most standard graphics formats, including bitmap, JPEG, GIF, TIFF, and numerous platform specific formats. In many cases, Mathematica even automatically detects the correct graphics format; otherwise, users can specify it themselves.
🌐
Wolfram
wolfram.com › broadcast › video.php
Wolfram Video Archive: How to Get an Image into Mathematica
Learn to easily import an image into Mathematica. Then analyze and customize your image with Mathematica's image processing functions. Video tutorial.
Top answer
1 of 3
8

Make your filenames unambiguously parsable, e.g. by consistently using some delimeters like underscores or something. A typical file name can look like "Electric_B_3.png". EDIT If you have no control over the file names, use string patterns as described by other answers, but in the long-term you may benefit from creating your own robust naming scheme END EDIT

Then write a function that would parse a single file name, something like:

fileNameParse[fname_String, delim_String: "_"] :=
   StringSplit[FileBaseName[fname], delim]

Then, Map it on FileNames["*.png", {your-dir}].

Finally, apply your importOne on the level one:

importOne@@@Map[fileNameParse, FileNames["*.png", {your-dir}]]

Since you have the result of Map available as well, you can regroup them any way you want. You can, for example, Map a function {#, importOne@@#}&, rather than just using importOne@@@.... Then, you could use GatherBy or any other means to regroup and collect your images according to the parts of their filenames.

EDIT

Here is a self-contained example ( I use text files, but this doesn't matter):

ClearAll[fileNameParse, fileNameMake, importOne, $dir];
fileNameParse[fname_String, delim_String: "_"] :=
    StringSplit[FileBaseName[fname], delim];

fileNameMake[pieces_List, delim_String: "_", ext_String: ".txt"] :=
    StringJoin[Append[Riffle[pieces, "_"], ".txt"]];

importOne[set_, cat_, num_, dir_: $dir] :=
    Import[FileNameJoin[{dir, fileNameMake[{set, cat, num}]}]];

We now create a temporary directory:

$dir = FileNameJoin[{$TemporaryDirectory, "ImportTest"}];
If[! FileExistsQ[$dir], CreateDirectory[$dir]];

Create sample files:

MapIndexed[
   Export[#, "Test" <> ToString[#2], "Text"] &,
   Flatten[
     Outer[
       FileNameJoin[{$dir, fileNameMake[{##}]}] &,
       {"Electric"}, {"A", "B", "C"}, {"1", "2", "3"}
     ]]];

import them:

imported = Map[{#, importOne @@ #} &,  fileNameParse /@ FileNames["*.txt", {$dir}]]

(* 
  ==>

     {{{"Electric", "A", "1"},  "Test{1}"}, {{"Electric", "A", "2"}, "Test{2}"}, 
      {{"Electric", "A", "3"},  "Test{3}"}, {{"Electric", "B", "1"}, "Test{4}"}, 
      {{"Electric", "B", "2"},  "Test{5}"}, {{"Electric", "B", "3"},  "Test{6}"}, 
      {{"Electric", "C", "1"},  "Test{7}"}, {{"Electric", "C", "2"},  "Test{8}"}, 
      {{"Electric", "C", "3"}, "Test{9}"}
      }
*)

You can now, for example, group them according to whatever parts of their file names you wish:

GatherBy[imported , #[[1, 2]] &][[1]]

(* 
 ==>

{{{"Electric", "A", "1"}, "Test{1}"}, {{"Electric", "A", "2"}, "Test{2}"}, 
   {{"Electric", "A", "3"}, "Test{3}"}}

*)
2 of 3
7

Here is one approach. First set your working directory with SetDirectory, then:

names = FileNames["*.png"];

groups = GatherBy[names, StringTake[#, {-6}] &];

Evaluate[
   electric[StringTake[#, {-6}]] & /@ groups[[All, 1]]
] = Map[Import[#] ~ImageResize~ 128 &, groups, {2}];

Now access image lists like:

electric["B"]

This relies on manually picking a string position to index by, here {-6}. Leonid's method would be more robust for future naming.

🌐
Wolfram Language
reference.wolfram.com › language › ref › Image
Image: Raster graphics as 2D grid of pixels (JPEG, PNG, etc.)—Wolfram Documentation
Upon output, an Image formats as a picture of the actual image, not as a 2D array of values. Image objects may be exported to a variety of standard image formats using Export, and images in a number of formats may be imported as Image objects using Import.
🌐
Wolfram Documentation
reference.wolfram.com › language › howto › ImportAndExportImages.html.en
Import and Export Images—Wolfram Documentation
Use the Insert ▶ File Path menu item or type a file path to import a local image file as an image object.