Home ] Up ] 

In doing this, I decided to exclude anything below
index[16],(215,211,231)
and above
index[239],(123,0,0)
which gives me two error colors to notify that I've exceeded bounds.

Samples, [dark] [normal] [light]


Two pixels in the "dark" image is errored.


Entire grout is errored, in which case I correct by finding appropriate match,
Or simply restoring old ground color.


In this case, I restored.

int shiftcolor(int pixel, int direction)
    {
     int check, limit, bump;
     check = pixel & 0xF0;
     if ((check > 143) && (check < 224))
       limit = check + 15;
     else
       limit = pixel & 0xF8 + 7;

     bump = pixel;
     if ((pixel > 15) && (pixel < 240))
       { bump = bump + direction;
         if (bump < check) bump = 10;
         if (bump > limit) bump = 240;
       }

     return bump;
    }