0

Inside the for loop

        // temporary storage
        RGBTRIPLE triple;

        // read RGB triple from infile
        fread(&triple, sizeof(RGBTRIPLE), 1, clue_ptr);

        if(triple.rgbtRed >0)
            triple.rgbtRed = 0x000000;

        fwrite(&triple, sizeof(RGBTRIPLE), 1, solution_ptr);                

I added that if the Red color into 0, i.e. remove the red color. Why is the picture become more red than removing red?

2
  • I don't really think it would become more Red. Rather it would become more of a Cyan or something. – kzidane Jan 11 '15 at 14:09
  • why cant i remove RED? – Hang Man Jan 12 '15 at 5:42
2

When you try to remove the red pixels from the image, what you're really trying to do should be to convert the red pixels into white pixels. So it's useful to know...
a black pixel is Red = 0x00, Green = 0x00, Blue = 0x00
and a white pixel is Red = 0xff, Green = 0xff, Blue = 0xff

So if you're trying to convert a colored pixel into a while pixel, you add color, not subtract color.

This won't solve the problem of only converting red pixels, should help you get on course.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .