Algosim documentation: AverageColor

AverageColor

Computes the average colour in a pixmap or a part of a pixmap.

Syntax

Description

AverageColor(pm) returns the RGB average colour in pm.

AverageColor(pm, x, y, w, h) returns the RGB average colour in the rectangular part of pm with top-left corner (x, y), width w and height h.

Examples

S ≔ ExampleData("Sally")

Image 1

AverageColor(S)
rgba(0.338, 0.346, 0.189, 1.000) (#565830)
AverageColor(S, 65, 0, 50, 360)
rgba(0.912, 0.259, 0.022, 1.000) (#E84206)