Change the image colors

  1. last week

    Emile S

    Aug 10 Europe (France, Strasbourg)

    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 ?

  2. Jeff T

    Aug 10 Pre-Release Testers Midlands of England, Europe

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

  3. Emile S

    Aug 10 Europe (France, Strasbourg)

    All of these but native Xojo.

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

  4. Jeff T

    Aug 10 Pre-Release Testers Midlands of England, Europe

    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

  5. Emile S

    Aug 11 Europe (France, Strasbourg)

    @Jeff T What do you think a value of -1 and -255 is supposed to do?

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

    @Jeff T What do you WANT the image to look like, and how does it actually look?

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

    I get fluo colors.

    @Jeff T You can supply 3 arrays as the parameters

    I’ve done that.

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

    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.

or Sign Up to reply!