red = (unsigned) red * (unsigned) alpha / 255; green = (unsigned) green * (unsigned) alpha / 255; blue = (unsigned) blue * (unsigned) alpha / 255;
red = ((unsigned) red * (unsigned) alpha + 127) / 255; green = ((unsigned) green * (unsigned) alpha + 127) / 255; blue = ((unsigned) blue * (unsigned) alpha + 127) / 255;
premultiply_data (png_structp   png,                  png_row_infop row_info,                  png_bytep     data){    int i;    for (i = 0; i < row_info->rowbytes; i += 4) {	unsigned char  *base = &data[i];	unsigned char  blue = base[0];	unsigned char  green = base[1];	unsigned char  red = base[2];	unsigned char  alpha = base[3];	unsigned long	p;	red = (unsigned) red * (unsigned) alpha / 255;	green = (unsigned) green * (unsigned) alpha / 255;	blue = (unsigned) blue * (unsigned) alpha / 255;	p = (alpha << 24) | (red << 16) | (green << 8) | (blue << 0);	memcpy (base, &p, sizeof (unsigned long));    }}