Aug-16-2019, 04:14 PM
(Aug-16-2019, 01:38 PM)ThomasL Wrote: Do you know Numpy?
An images can be represented as an array of values.
I actually don´t understand why you are building a bmp with strings / bytes / bytestrings or what so ever.
There are lots of tutorials around this matter http://scipy-lectures.org/advanced/image_processing/
Ok Ive taken a quick look at numpy.
1. Am I correct that numpy itself does not contain output function?
2. One strategy could be to build the pixel grid as an numpy 2-D array (indexing, no catenations) then ravel it and convert to byte string for the same file.write() as presently. Not clear to me if that would be trivial out of the box code or very fiddly?
3. It looks like scipy has some output functions (imsave) but does it handle all the headers properly?
(Just looking for a roadmap so I dont go down too many dark alleys!)