private void calculateBitsPerPalette() throws IOException {

		switch (colorType) {
			case 0:
				if (bitDepth == 1 || bitDepth == 2 || bitDepth == 4 || bitDepth == 8 ||
					bitDepth == 16) {
					bitsPerPalette = bitDepth;
					break;
				}
			case 2:
				if (bitDepth == 8 || bitDepth == 16) {
					bitsPerPalette = 3 * bitDepth;
					break;
				}
			case 3:
				if (bitDepth == 1 || bitDepth == 2 || bitDepth == 4 || bitDepth == 8) {
					bitsPerPalette = bitDepth;
					break;
				}
			case 4:
				if (bitDepth == 8 || bitDepth == 16) {
					bitsPerPalette = 4 * bitDepth;
					break;
				}
			case 6:
				if (bitDepth == 8 || bitDepth == 16) {
					bitsPerPalette = 4 * bitDepth;
					break;
				}
			default:
				throw new IOException("Unknown color type: " + colorType);
		}
	}
<pre>
	   From PNG Specs, http://www.w3.org/TR/PNG-Chunks.html
	   Color    Allowed    Interpretation
	   Type    Bit Depths
	   ------  ----------  ----------------------------------
	   0       1,2,4,8,16  Each pixel is a grayscale sample.
	   
	   2       8,16        Each pixel is an R,G,B triple.
	   
	   3       1,2,4,8     Each pixel is a palette index;
	                       a PLTE chunk must appear.
	   
	   4       8,16        Each pixel is a grayscale sample,
	                       followed by an alpha sample.
	   
	   6       8,16        Each pixel is an R,G,B triple,
	                       followed by an alpha sample.
</pre>
Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/ios/png/IHDRChunk.java