Change the image colors

I wanted to keep the Red color of an image and so I tried Transform.Surface.

I get a result, but not what I expected. I set Green and Blue to -1, 0, 255 and -255 with different results, but not the expected one.

Ideas ?

32 or 64 bit?
Windows or Mac?
Windows version?

All of these but native Xojo.

Emile who is asking himself about how a Red can be diferent in these cases… :wink:

What do you think a value of -1 and -255 is supposed to do?
What do you WANT the image to look like, and how does it actually look?

The syntax of Transform is overloaded.
You can supply 3 arrays as the parameters

RGBSurface.Transform(RedMap() as Integer,GreenMap() as Integer,BlueMap() as Integer)

The arrays are integers, but they are expected to have values between 0 and 255

To retain only the red portion of the image, you should supply A greenmap of 256 zeroes and a bluemap of 256 zeroes

I was searching (I used 0 and 255 as well).

I wanted to get RedScale / GreenScale /BlueScale à la GreyScale (that I want to…).

I get fluo colors.

I’ve done that.

I think… I’ve done that.

I’d better take a day or two of rest and think, then make some more home work (with notes on what I’ve done and the results).

In the mean time, I used RGBSurface’ Pixel and it was nice (and fun). I had an image with 4 colors (beside black and white), and the blue disappears then the green is transformed to yellow… (I was working on the Blue part of the clut/ image).
That is why I think I have to wait a bit, then resume with a “fresh” mind to write the correct design.

Thank you.