activities
latest
false
UiPath logo, featuring letters U and I in white

UI Automation Activities

Last updated Jun 18, 2025

How to analyze image color data

Comprehensive API reference for enterprise-grade image color detection and analysis capabilities.

ImageColorData Properties

PropertyReturn TypeDescription
ImageBase64stringBase64-encoded string representation of the source image data, enabling efficient storage and transmission of image content across different systems and platforms.
PixelsPixelImageData[]Complete array of pixel color information for the entire image, providing comprehensive access to individual pixel data for detailed color analysis.
WidthintHorizontal dimension of the image measured in pixels, defining the image's width for coordinate calculations and boundary validation.
HeightintVertical dimension of the image measured in pixels, defining the image's height for coordinate calculations and boundary validation.
OffsetPointPoint?Optional coordinate point for targeted pixel analysis, allowing focused color extraction from specific regions of interest within the image.
CenterColorPixelImageData?Pixel color data located at the geometric center of the image, useful for analyzing the primary focal point or central theme.
OffsetPointColorPixelImageData?Pixel color data at the user-defined offset coordinates, providing precise color sampling at custom locations when OffsetPoint is specified.
DominantColorColorMost frequently occurring color across all image pixels, calculated through statistical frequency analysis and Euclidean distance comparison to identify the primary color theme.
DominantUICoreColorNUICoreColorMost prevalent UI core color classification within the image, determined using Euclidean distance calculations between each pixel and target UI core colors, then selecting the most frequently matched color.
DominantKnownColorKnownColorMost common standardized system color found in the image, mapped to predefined color constants using Euclidean distance calculations for consistent cross-platform identification.

ImageColorData Methods and Extensions

MethodReturn TypeDescription
GetPixelImageData(x, y)PixelImageData?Retrieves pixel color information at specified coordinates. Returns null for invalid coordinates or empty image data. Performs boundary validation automatically.
GetDominantColor()ColorAnalyzes all image pixels and returns the most frequently occurring color. Uses statistical frequency analysis combined with Euclidean distance calculations to determine color dominance. Returns Color.Empty for empty images.
GetDominantUICoreColor()NUICoreColorIdentifies the most prevalent UI core color within the image through pixel classification using Euclidean distance calculations between each pixel and target UI core colors, then frequency counting of matches. Returns NUICoreColor.None for empty images.
GetUICoreColors()IEnumerable<UICoreColorFrequency>Generates a comprehensive frequency-ordered list of all UI core colors detected in the image using Euclidean distance matching, enabling detailed color distribution analysis.
GetUICoreColors(colorFilter)IEnumerable<UICoreColorFrequency>Returns filtered UI core colors based on specified criteria, sorted by frequency. Applies custom filtering logic while maintaining Euclidean distance-based statistical accuracy.
GetDominantKnownColor()KnownColorDetermines the most common standardized known color in the image through systematic color matching using Euclidean distance calculations. Returns KnownColor.Transparent for empty images.

PixelImageData Properties

PropertyReturn TypeDescription
XintHorizontal coordinate position of the pixel within the image coordinate system, zero-indexed from the left edge.
YintVertical coordinate position of the pixel within the image coordinate system, zero-indexed from the top edge.
ValueintPacked 24-bit RGB color value stored as an integer, with red occupying bits 16-23, green bits 8-15, and blue bits 0-7.
RbyteRed color component intensity ranging from 0 (no red) to 255 (maximum red saturation).
GbyteGreen color component intensity ranging from 0 (no green) to 255 (maximum green saturation).
BbyteBlue color component intensity ranging from 0 (no blue) to 255 (maximum blue saturation).
RawColorColorExact System.Drawing.Color representation with precise RGB values, maintaining full color fidelity without approximation.
ColorColorClosest named System.Drawing.Color that matches the pixel's RGB values using Euclidean distance calculations, providing human-readable color identification.
CoreColorNUICoreColorBest-matching UI core color classification for the pixel, determined through Euclidean distance calculations in RGB color space for optimal user interface color scheme analysis.
KnownColorKnownColorNearest equivalent from the System.Drawing.KnownColor enumeration using Euclidean distance comparison, ensuring standardized color naming across applications.

PixelImageData Extension Methods

MethodReturn TypeDescription
GetColor()ColorConverts pixel data to exact System.Drawing.Color representation without approximation, preserving original color precision and RGB values.
GetClosestColor()ColorIdentifies the nearest named color from the System.Drawing.Color collection using Euclidean distance calculation in RGB color space.
GetUICoreColor()NUICoreColorMaps pixel color to the most appropriate UI core color classification using optimized Euclidean distance algorithms in RGB color space for interface analysis.
GetKnownColor()KnownColorMatches pixel color to the closest System.Drawing.KnownColor enumeration value through comprehensive Euclidean distance comparison in RGB color space, excluding system-dependent colors.

UICoreColorFrequency Properties

PropertyReturn TypeDescription
ColorNUICoreColorThe specific UI core color that was detected and analyzed within the image, representing one of the predefined interface color classifications.
CountintThe frequency count indicating how many pixels in the image matched this specific UI core color through Euclidean distance calculations, providing statistical data for color distribution analysis.

UI Element Color Analysis Samples

The following examples demonstrate dominant color analysis for common UI elements in different states:

Icon State Analysis

Icon TypeVisual SampleStateDimensionsDominant ColorDominant UI Core ColorUse Case
Error Icondocs imageError/Failed32x32#e74c3cRedValidation errors, failed operations, critical alerts
Warning Icondocs imageWarning/Alert32x32#f1c40fYellowImportant notices, attention required, caution
Success Icondocs imageSuccess/Complete32x32#27ae60GreenCompleted tasks, successful validation, confirmation
Verified Icondocs imageVerified/Trusted32x32#9b59b6MagentaVerified accounts, trusted sources, premium status
Info Icondocs imageInformation32x32#3498dbBlueInformational messages, help text, guidance

Color Analysis Insights

  • Semantic Color Consistency: Error states consistently analyze as Red UI core color, Success as Green, Warnings as Orange/Yellow.
  • Brand vs Standard Colors: Custom brand colors (like #27ae60) map to standard UI core colors (Green) through Euclidean distance calculations.
  • Visual Hierarchy: Different UI elements use color intensity and styling while maintaining consistent semantic color classification.
  • Accessibility Compliance: Color analysis helps verify sufficient contrast ratios and semantic meaning across different UI states.
  • Automation Testing: Dominant color detection enables automated verification of UI state changes and visual feedback.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2025 UiPath. All rights reserved.