Results 1 to 8 of 8

Thread: Tolerance question

  1. #1
    Join Date
    Jun 2007
    Location
    Belgium
    Posts
    333
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Tolerance question

    Could anyone tell me what range tolerance actually gives, all the tuts i've read so far cover the use of it but i can't find any explaining it actually. I understand that it gives a range of the initial color, but what is the range actually?

    For example:
    FindColorTolerance(x, y, 461883, MMX1, MMY1, MMX2, MMY2, 1)
    Does that search between 461882 and 461884 or between 461873 and 461893 or...

  2. #2
    Join Date
    Dec 2007
    Posts
    103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Good question. I can't tell you, but I don't believe it only changes the last digit (as in 461883 with tolerance 1 will search between 461882 and 461884). It doesn't take much tolerance to find a huge color-difference. I'd guess it changes the 2nd or 3rd digit (461884) - but I have no idea.
    This sentence is false.

  3. #3
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    This is taken from freddy1990's old site :

    SCAR Code:
    function SimilarColors(Color1, Color2, Tolerance: Integer): Boolean;
    begin
      Result:=False;
      if(Abs(Round(ColorRGB(Color1, 1))-Round(ColorRGB(Color2, 1)))<=Tolerance)then
      begin
        if(Abs(Round(ColorRGB(Color1, 2))-Round(ColorRGB(Color2, 2)))<=Tolerance)then
        begin
          if(Abs(Round(ColorRGB(Color1, 3))-Round(ColorRGB(Color2, 3)))<=Tolerance)then
            begin
              Result:= True;
            end;
        end;
      end;
    end;

    Meaning it checks the difference in R, G and B.
    Administrator's Warning:


  4. #4
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    A color is built out of 3 things. Red, Green and blue. (RGB).

    To find the RGB of a Color
    SCAR Code:
    procedure ConvertColorToRGB(Color: integer); //By nielsie
    begin
      WriteLn('Red: '+IntTostr(Color mod 256)+' Green: '+IntToStr((Color / 256) mod 256)+' Blue: '+IntToStr((Color / 256) / 256));
    end;

    Tolerance will Add 1 tolerance to the R G and B.

  5. #5
    Join Date
    Jun 2007
    Location
    Belgium
    Posts
    333
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you Sumilion and Rikje, that explained it for me

  6. #6
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    That is actually CTS 0. CTS 1 is more like some kind of distance for RGB.
    I made a new script, check it out!.

  7. #7
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by Markus View Post
    That is actually CTS 0. CTS 1 is more like some kind of distance for RGB.
    make a tut on those p10xors? like a tut on XYZ, RGB ect ect... please

  8. #8
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Tolerance
    By jhildy in forum Research & Development Lounge
    Replies: 1
    Last Post: 08-18-2007, 01:07 PM
  2. color tolerance question
    By omgh4x0rz in forum OSR Help
    Replies: 4
    Last Post: 03-14-2007, 02:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •