Спасибо за внимание и советы.
№ день поисков не увенчался успехом. В итоге воспользовалась советом modbear. Пишу на C#.
Может кому полезно будет:
public static Color FirstStep(Bitmap orig)
{
Bitmap bmp = new Bitmap(1, 1);
using (Graphics g = Graphics.FromImage(bmp))
{
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
g.DrawImage(orig, new Rectangle(0, 0, 1, 1));
}
Color pixel = bmp.GetPixel(0, 0);
return pixel;
}
System.Windows.Rect boundingRect1;
protected readonly AutomationElement _element;
object boundingRectNoDefault = _element.GetCurrentPropertyValue(AutomationElement.BoundingRectangleProperty, true);
if (boundingRectNoDefault == AutomationElement.NotSupported)
{
Log.Warning("Failed get elemnt promary color");
}
else
{
boundingRect1 = (System.Windows.Rect)boundingRectNoDefault;
System.Drawing.Rectangle bounds = new System.Drawing.Rectangle((int)boundingRect1.Left, (int)boundingRect1.Top, (int)boundingRect1.Right - (int)boundingRect1.Left, (int)boundingRect1.Bottom - (int)boundingRect1.Top);
var result = new System.Drawing.Bitmap(bounds.Width, bounds.Height);
using (var g = System.Drawing.Graphics.FromImage(result))
g.CopyFromScreen(new System.Drawing.Point(bounds.Left, bounds.Top), System.Drawing.Point.Empty, bounds.Size);
System.Drawing.Color primarycolor = PictureAnalysis.FirstStep(result);
var deltaE = CompareColors(primarycolor, System.Drawing.Color.Black);
var eps = new System.Drawing.Imaging.EncoderParameters(2);
}