I have an image that I want to perform quantization on it. I want to use PIL and Numpy libraries and the original image is:
and I expect the output for 2-level quantization to be like this:
but the output is like this:
What am I doing wrong?
from PIL import Image
import PIL
# creating an image object (main image)
im1 = Image.open(r'File Address').convert('L')
# quantize a image
im1 = im1.quantize(2)
# to show a specified image
im1.show()