Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

196
Views
How to get average color from pixels within polygon?

I have canvas object, and within it some image.

I also do have polygons defined as arrays of vertices, for example:

[ {x:50, y:50}, {x:50, y:150}, {x:200, y:100} ]

This is very simple polygon, some will be more complicated (currently the max is 10 points).

I'd like to either find a way to enumerate all pixels within the polygon, or just find average color of it.

Is there any library to do it? Or some clever algorithm?

As for comment re: getting image data by pixel - I know how to get color of a pixel. But what about getting it for all pixels within polygon?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!