Is there any method available in general libraries that can load images to a pre allocated array (to avoid allocations during runtime), assuming the user knows the image size (or pre allocates a larger array and fills a view of it). For videos there is a function VideoIO.read! that does this, but I’m unaware of any for images.
What kind of image format?
Hopefully, as many formats as possible. For starters, uncompressed formats like portable graytone map.
(post deleted by author)
Have you looked into memory-mapped IO? Whether this is what you want will depend on the format of your image; I suggest providing more detail in your question (see here).
GDAL reads pretty much everything and it requires that a pre-allocated buffer is passed in to store the image. So, I guess ArchGDAL.jl and GMT.jl (gdalread function, but this is only from memory) should fill your condition.