karansher / computer-graphics-raster-images

Computer Graphics Assignment about Raster Images
1 stars 0 forks source link

rgb yellowish dog #58

Closed cccccz closed 6 months ago

cccccz commented 1 year ago

image This is my output for rgb.ppm. It looks too yellow to me but I have no clue how to fix it...

abhimadan commented 1 year ago

In rgba_to_rgb, you just drop the alpha channel when copying to the output buffer. To find out what's going on here, try using a debugger to see what values you copy to the output buffer, or print out each RGBA pixel and compare it with your ppm file read as a text file.

cccccz commented 1 year ago

In rgba_to_rgb, you just drop the alpha channel when copying to the output buffer. To find out what's going on here, try using a debugger to see what values you copy to the output buffer, or print out each RGBA pixel and compare it with your ppm file read as a text file.

Thank you for the reply! I see that in my ppm file, the blue value is always 0, i think that's where the problem came from.