I'm looking for a way to get image pixels as numpy array from actual image files (.png, .jpeg, .tif, etc.) without loading them into Blender. I know there are tons of image processing modules and packages but afaik none of them is included in Blender, so they can not be used for add-ons. Anyway including the whole someone's 3rd party module in the add-on just for this task doesn't seem like a solution.
The question is: is there a way to access image files pixel data using only built-in modules? I need to do just a simple image processing (blending several images into a single one) and getting access to image pixels bypassing Blender API would allow to use threading or multiprocessing (which Blender API doesn't support at the moment) to speed up this process.
UPD. As I see now it is more complicated than it seemed at first. Each image file type has its own file layout. You can easily get the bytes sequence from file with built-in img_file = open().read() and then convert bytes to floats for example with memoryview(img_file[:]).cast('f') but you need to know exactly what bytes in the file represent pixel data and in what order to decode them properly. Trying to get through OpenEXR file layout which I exactly need for my add-on seems beyond my ability at the moment.
numpyin Blender. Although you will need to deal with all possible file format and the data for various type of images. It is not that bad to install new module inside Blender with addon if you do "inform" user that you are going to download and install required packages. – HikariTW Sep 15 '20 at 13:36