Oh, my bad, I thought I know the manual by heart!
thanks so much for letting me know
- truly useful thing!


This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuoteHow does "RGB least square diff " work?I meant, for every x,y cell on active layer, separately for background and foreground, we're looking for such palette index (0-255) on active palette which results in smallest color error given by:
int ColorDiff(uint8 rgb1[3], uint8 rgb2[3])
{
static const int w[3] = {3,4,1}; // human is less sensitive to blue changes, this could be configurable
int dr = rgb1[0] - rgb2[0]; // per channel difference
int dg = rgb1[1] - rgb2[1];
int db = rgb1[2] - rgb2[2];
return w[0]*dr*dr + w[1]*dg*dg + w[2]*db*db; // weighted sum of square diffs
}
QuoteThere being multiple ways to define that...Yep I'm aware of that, simple RGB least square diff would be a thing!
Quoteexternal text fileI bet this is the most user friendly way.