Hello,
In which way the image is compressed?
To my understanding, the colors is compressed to 16 colors, but the X_recovered itself isn’t compressed. I know it is absolutely compressed, any hints are appreciated.
Hello,
In which way the image is compressed?
To my understanding, the colors is compressed to 16 colors, but the X_recovered itself isn’t compressed. I know it is absolutely compressed, any hints are appreciated.
Hello @Daniel_Zhao
Your understanding is correct.
However, X_recovered.size
does not show you the number of colors. Try to find the number of colors in X_recovered
!
Cheers,
Raymond
How the number of color make the image small?
128x128
pixel image, each pixel requires 24 bits
(8 bits for each RGB channel).K
(16 in your case).K
most representative colors (centroids) of the image. Each pixel is then assigned to the nearest centroid color.K
colors instead of the full spectrum of colors.How to check how many colors for each image?
Hi @Daniel_Zhao,
Each value in the picture array (compressed or not) is a color value. In other words, to see how many different colors are used, you go through the array, and make a count of how many different values are ever used.
You can write loops to do it.
Or you may study this - numpy.unique. Just go to its documentation for how it works and what it does, and it should help you.
Cheers,
Raymond