[02:39:25] <cats> hey all, I'm having some trouble working with bilevel pngs with pillow, can anyone help me out real quick?
[15:49:46] <wiredfool1> hi cats -- what seems to be the problem?
[15:58:55] <cats> wiredfool: I'm getting different array representations when I open an image from a filename and when I open from a buffer
[16:00:49] <cats> on top of that, it seems that writing pngs back to disk with mode '1' is broken sometimes? It appears that instead of treating each value in the array as a bit value, it's considered as an entire byte - leading to 7 black pixels + 1 black/white pixel depending on the array value
[16:32:35] <wiredfool> internally, everything is stored as bytes, not bits
[16:32:48] <wiredfool> so if you're doing bit twiddling, that's going to throw you off.
[16:44:48] <cats> I can't share the image I'm testing on directly since it contains sensitive info, but you can generate a sample image from a pdf as I did using ghostscript: gs -sDEVICE=pnggray -sOutputFile=OUTPUTPNG -dFirstPage=1 -dLastPage=1 -dSAFER -dQUIET -dBATCH -dNOPAUSE -r300 INPUTPDF
[16:45:17] <cats> and I would replace the -sDEVICE parameter with pngmono