It appears that the bits are vertically flipped every 8 bits. The file was written and read on a little-endian machine. Is there any way to change this?
I believe this is coming from the least significant bit being in the leftmost position of each byte so I need to do a bit swap operation, which AFAIK there isn’t a dedicated Julia function for? (bswap swaps bytes)
Not really familiar with .tif, but have you tried using Images.jl to read your image? They’re using FileIO.jl in the background which has explicit support for .tif files, maybe they do the flipping already?