}
if (colortype == PNG_COLOR_TYPE_GRAY && bitdepth < 8){
png_set_gray_1_2_4_to_8(png_ptr);
png_set_expand_gray_1_2_4_to_8(png_ptr);
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)){