I am trying to convert a batch of monochrome PNGs to raw 1-bit data, i.e. 8 ON/OFF pixels represented by each byte. My issue is that the output's bit order within each byte (not the byte order) is the opposite of what I need. As a result, each successive group of 8 pixels is flipped on the X axis.
For my purposes the most significant bit should be the leftmost pixel. For example, if my input has one pixel 'ON' followed by seven pixels OFF (left to right), I'd expect a byte value of 10000000 binary, but IM outputs 00000001.
Can this be fixed? I've tried various permutations of options like:
Code: Select all
magick convert input.png -monochrome -depth 1 MONO:test1.raw magick convert input.png -type bilevel MONO:test2.raw