> + else > + { > + png_palette[i].red = 0; > + png_palette[i].green = 0; > + png_palette[i].blue = 0; > + } Why is it necessary to pad the palette in this way? Couldn't you just pass the appropriate number of colors?