pylibjpeg-openjpeg
pylibjpeg-openjpeg copied to clipboard
Encoding random 1-bit images fails
There's an upstream issue with openjpeg not encoding 1-bit images correctly if they're over a certain size. Which I missed in testing because I set the upper limit on the random arrays incorrectly (range is [0, high), not [0, high]...)
Workaround is to use a precision of 2 instead.
After a bit more exploring I think that this should be OK for most normal 1-bit images, it's using purely random images that's one of the causes of the issue.