if(depth!=1&&depth!=2&&depth!=4&&depth!=8)returnstbi__err("1/2/4/8-bit only","PNG not supported: 1/2/4/8-bit only for palettized images");// support 1/2/4 bpp for palettized.
}else{
if(depth!=8)returnstbi__err("8-bit only","PNG not supported: 8-bit only");// greyscale images (color==0) would need the pixel data to be scaled (see PIXEL macro)