I have 2d array of data - it is already 'normalised' - everything i divided by max value and then multiplied by 255 - so it gives me 0-255 values in table. What should I do to get grayscale image as output? I already tried sth with FlattenPixmap and DrawFlatenedPixmap but it give me black or gray uniform pixture with different size. I tried it with rounding and some examples i found on the Internet but it does not give me satifying solution.
Any sugesstions?
There is a code and input data I use. It brings me just white picture.
PS The data is the linear fit of phasegram for thermograms obtained via FFT. I want to detect the defect using pulse phase therography.
Start by taking the absolute value of your array first. Right now you are dividing by the largest value. Since your numbers are negative, that means the value that is closest to zero. Dividing everything else by that means all your other values get to be greater than 1 after normalizing.
Second, your values are all pretty close to each other. So once I normalize them, they all windup being about 225.xxxx and look like they are the same color. You probably want to stretch the smallest to the largest between 0 and 255. Not just 0 to themselves between 0 and 255.
1. Absolute value.
2. Find smallest value.
3. Subtract from Array.
4. Find largest value.
5. Array divided by that times 255.
Once I do those steps, I get something meaningful.

Thanks for the response! i should have think it out sooner! silly mistakes.
The image I get is rotated by 90 degrees is it possible to get it without rotation?
I had found this link also, and posted a message on it. But that message isn't showing up.
https://decibel.ni.com/content/docs/DOC-2283
EDIT: I found it. It posted in a different message that I wasn't even trying to reply to.
@RavensFan wrote:
I had found this link also, and posted a message on it.
That's a different link, though. Mine is more universal. 😄
Here's about the same with less math.
(Well, it is not the same, because this one scales the grayscale from lowest to highest, while Ravens version inverts the greyscale because it operates on absolute values of a negative array.Taking the absolute value seems dangerous if there is a possibility that the input contains both positive and negative values, for examples. What to use depends what the data means. To get Ravens result in the current case, we could just reverse the color ramp.)
