karansher / computer-graphics-raster-images

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

Output Problem #56

Open aiden-linhaoze opened 1 year ago

aiden-linhaoze commented 1 year ago

The output of my program seems a little bit awkward, and I am having trouble finding the reason as I almost made no change in my src and other settings but my output changes from quite normal ascii symbols to a weird combination. I am wondering how this happened. 1

abhimadan commented 1 year ago

You need to output the pixel values as integers in the text file, but unsigned chars are interpreted as ASCII characters, which is why you see weird symbols in your output. To make sure that the pixel values actually written as integers, you need to cast them to another value first.