Kept seeing `DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead imageBuf = np.fromstring(imageBin, dtype=np.uint8)`, this fixes the issue.