이진 화상을 각 화소가 1 또는파이썬 반전 바이너리 이미지; .invert()는 I
import struct
from PIL import Image
import numpy
...
i1 = Image.frombytes('1', (64, 63), r[3], 'raw')
0 어떻게 이미지를 반전 할 수있다 64x63 사이즈 실패? 이것은 오류가 발생, 그러나
from PIL import Image
import PIL.ImageOps
i1 = PIL.ImageOps.invert(i1)
: 편집
내가 제안 된 솔루션을 시도
raise IOError("not supported for this image mode")
IOError: not supported for this image mode
그리고 이것은, 내가 생각 때문이다 이미지가 RGB도 아니고 L (그레이 스케일)도 아닙니다. 대신, 바이너리 이미지의 각 픽셀이 아니라 파일 중 하나가 0 또는
가능한 [PIL (Python-Imaging)을 사용하여 이미지의 색상을 반전하는 방법?] (http://stackoverflow.com/questions/2498875/how-to-invert-colors-of-image-with-pil) -python-imaging) – 9000
의심스러운 경우 Google을 먼저 선택하십시오. – 9000
제안 해 주셔서 감사합니다! 그러나 이진 이미지가 지원되지 않는다는 PIL의 오류를 받았지만이 작업을 시도했습니다. – wayway