-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
imwrite doesn't handle pbm #9791
Copy link
Copy link
Closed
Description
System information (version)
- OpenCV => 3.2.0
- Operating System / Platform => Ubuntu 16.04
Detailed description
If you try to save some monochrome image as bitmap ( .pbm P1/P4) you get a greymap (P2/P5) picture at outcome.
Steps to reproduce
A simple example:
import numpy as np
import cv2
img = np.array([0, 0, 0, 0]).reshape((2,2))
cv2.imwrite('/tmp/out.pbm', img, (32, 0))And out.pbm looks like this:
P2
2 2
255
0 0
0 0
Reactions are currently unavailable