Local $count = 1
Local $x1= 100,$y1 = 100,$x2 = 110,$y2 = 110
$area = ($x2+$x1)*($y2+$y1)
Local $array[$area][2]
For $i = $x1 to $x2 Step 1
For $j = $y1 to $y2 Step 1
$color = PixelGetColor($i,$j)
$scolor = Hex($color,6)
$array[$count][2] = [$scolor,1]
$position = _ArraySearch($array,$scolor,0,0,0,0,1)
If $array[$position][0] = $scolor Then
$array[$position][1] +=1
Else
$count += 1
EndIf
Next
Next
_ArrayDisplay($array)
plz help adjust and shrink it down soo confusing playing with array