I have written code to parse BMP images to put the intensity values into a matrix
I'm experiencing a very very wierd problem: if the size of the BMP is a nice power of 2 like 8x8, then it works fine. but if the BMP size is like 7x7, I get big problems
most noticeably, the number of rows that are actually storing the pixels seems to be slightly less than the actual number of rows in the BMP...causing the image to "slant"
additionally, pixel values are not preserved. for instance, if my image was all pure white (255) with a single pixel black line down the center (0), then it will be slanted (and the slope is not always 1, sometimes it is a more like 0.3)...and additionally, there will be values between 0 and 255 surrounding this line.
The only thing I can imagine is that there is some form of compression occuring at certain filesizes...but the BMP header file says compression=0
I'm experiencing a very very wierd problem: if the size of the BMP is a nice power of 2 like 8x8, then it works fine. but if the BMP size is like 7x7, I get big problems
most noticeably, the number of rows that are actually storing the pixels seems to be slightly less than the actual number of rows in the BMP...causing the image to "slant"
additionally, pixel values are not preserved. for instance, if my image was all pure white (255) with a single pixel black line down the center (0), then it will be slanted (and the slope is not always 1, sometimes it is a more like 0.3)...and additionally, there will be values between 0 and 255 surrounding this line.
The only thing I can imagine is that there is some form of compression occuring at certain filesizes...but the BMP header file says compression=0