Added averageBrightness