最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

jquery - JavaScript - Get average color from a certain area of an image - Stack Overflow

programmeradmin8浏览0评论

I need to get the average color from a rectangle area of an image using JavaScript.

I tried using tracking.js but it doesn't allow to specify areas instead of single pixels.

I need to get the average color from a rectangle area of an image using JavaScript.

I tried using tracking.js but it doesn't allow to specify areas instead of single pixels.

Share Improve this question edited Jun 15, 2017 at 5:22 Danziger 21.2k6 gold badges58 silver badges88 bronze badges asked Jun 15, 2017 at 0:28 admin adminadmin admin 571 silver badge3 bronze badges 6
  • stackoverflow./questions/6735470/… – Will Reese Commented Jun 15, 2017 at 0:30
  • jsfiddle/DV9Bw/1 – Myco Claro Commented Jun 15, 2017 at 0:36
  • 1 @WillReese If you think this is a duplicate, you should flag the question as duplicate instead of just adding a ment with a link. Moreover, from the question I understand that the OP is trying to get the average color of an area of an image, not from a single value. I think it may not be clear enough though, but before marking this as duplicate and/or down-voting, you should consider asking for clarification. – Danziger Commented Jun 15, 2017 at 1:53
  • 1 @Danziger The link I provided simply has useful information if you can use a canvas to solve your issue. Its not quite a duplicate of that question. Also, I didn't downvote. – Will Reese Commented Jun 15, 2017 at 1:56
  • @MycoClaro WillReese already referred to the question/answer that contains that link you posted, so there's no need to copy that link here too. Actually, maybe you both happened to be menting at the same time, but you should prefer using SO links that contains a full explanation rather than external links that just contain working code. – Danziger Commented Jun 15, 2017 at 2:03
 |  Show 1 more ment

2 Answers 2

Reset to default 44

If you need to get the average color of a single pixel, rather than the color of a rectangular area, please take a look at this other question:

发布评论

评论列表(0)

  1. 暂无评论