ImageRead
Reads an image file from disk and return it
ResourceFunction["ImageRead"][type,file] reads file as a type image and returns the image. |
Details and Options
ResourceFunction["ImageRead"] bypasses most of the functionality of the Import making it less flexible and more limited, but significantly faster. It should be used judiciously when performance is critical.
Examples
Basic Examples
Export a random image as a PNG file:
In[1]:= |
Out[1]= |
Import the file with ImageRead one hundred times, noting the elapsed time:
In[2]:= |
Out[2]= |
Repeat the same experiment with Import:
In[3]:= |
Out[3]= |
Note how ImageRead is significantly faster than Import:
In[4]:= |
Out[4]= |
However, ImageRead only imports a file as an Image. Import provides many more options:
In[5]:= |
Out[5]= |