Reputation: 818
I ran the comand:
file *
and got the output:
spec_wav_17.png: PNG image data, 5 x 128, 8-bit colormap, non-interlaced
spec_wav_17.pngresize.png: PNG image data, 5 x 128, 8-bit/color RGB, non-interlaced
I have a huge difference in results between these two formats where RGB produces better results, I am trying to figure out what is happening.
I searched the manual for file and found nothing about these formats https://linux.die.net/man/1/file
Upvotes: 4
Views: 5659
Reputation: 5762
8-bit colormap means that you have a mapping between an 8 bit integer and a set of colors. With 8 bits you get 256 different entries, each one pointing to a different color, like 1->white, 2->yellow, 3->black... and so on.
8-bit/color RGB means that every pixel is represented by three colors (R, G and B, Red, Green and Blue), and each color is represented by an 8-bit integer. This means that each color can have 256 shades, from black to the color. The three colors together conform the final color. The total palette in this case is 256*256*256 colors in total.
All of this means that the colormap image have very few colors and uses only one bype per pixel, while the RGB image have 16 million colors and uses 3 bytes per pixel (raw images, no compression).
Upvotes: 5
Reputation: 207345
The former has a palette with 256 colours in it, and at each location in the image it stores a single number saying which one of those 256 colours is at that position.
The latter stores 3 numbers, one for red, one for green and one for blue, each in the range 0..255 for each pixel location, so each pixel can be any of 16.7 million colours (256 x 256 x 256), rather than any of 256 colours.
Upvotes: 4