How to determine the color mode of a .png file

2

How do you determine the color mode of a .png file? So if its black and white (grayscale) vs. RGB vs. RGB+transparency?

Can you do this without installing software? I am on windows (though I'm sure Mac/Linux users would like a answer too)

Christopher Pratt

Posted 2019-09-19T17:10:10.150

Reputation: 21

Answers

1

On *nix environments (Linux/MacOS) the file command should do it:

$> file aaa.png
aaa.png: PNG image data, 225 x 225, 8-bit colormap, non-interlaced

This exists on Windows via the WSL if it's enabled/installed, but I don't have a Windows machine to test it on.

See also: What is the equivalent to the Linux File command for windows?

Catskul

Posted 2019-09-19T17:10:10.150

Reputation: 573