for (int i = 0; i < imgHeight; i++) {
for (int j = 0; j < imgWidth; j++) {
RGBTRIPLE triple;
fread(&triple, sizeof(RGBTRIPLE), 1, inptr);
if (triple.rgbtRed == 0xa4 && triple.rgbtGreen == 0x90 && triple.rgbtBlue < 0x77) {
fwrite(&triple, 4, 1, outptr); // an additional NULL is written to ouput
} else {
fwrite(&triple, 3, 1, outptr);
}
}
}