Artificial Intelligence, Machine Learning, Science, Software Development, Information Technology.
np.clip(compressed_image.astype('uint8'), 0, 255) Here is the comparison between the original image and the compressed image. Original image Compressed image as the only 6 colours(k=6) used to represent the entire image, so it reduces the size. If you like my write-up, follow me on Github,