I have an array of integer. I want to create a monochrom (black to white) image. So each pixel will have a number coming form the array.
When the array contains only numbers lesser than 255, I just write these values to the corresponding pixels. And it works fine. But if I have a number which is great than 255, I can not directly write it because I guess char can take values between 0-255. My image format is "VICAR" maybe you have not heard this before but it supports also the values greater than 255. So somehow, I need to write a number like 300 into 2 bytes.