Skip to content

Function: estimateFocus() ​

ts
function estimateFocus(pixels): Focus;

A guess at what a photo is of: the most eye-catching spot, where color and brightness stand out most from their surroundings, with a slight preference for the middle. Good for a subject against a plainer background (a face, a flower, a sun); for busy pictures give the focus yourself. Pass small pixels (loadImagePixels gives at most 256 a side). The result includes the image's aspect.

Parameters ​

ParameterType
pixelsPixels

Returns ​

Focus

Hat tiling and isohedral tilings after Craig S. Kaplan's hatviz and Tactile (BSD 3-Clause).