Retrieve image colour from display?

edited July 2014 in How To...

I wish to create a small application to tag along my existing software. I need the most prominent colour of the screen/display.

https://www.processing.org/reference/get_.html

What's the best way to go about this? The idea is that the image changes every 30seconds or at a random interval. Is taking a screenshot every 5 seconds, processing it and getting the colour a bit overkill? is there anway to retrieve the colour from the current display on regular intervals?

Any help is appreciated, i'm not even sure this is the right path i should be approaching :)

Tagged:

Answers

  • I need the most prominent colour of the screen/display.

    Processing uses 32bit colour so a single pixel can be any of 16,777,216 possible colours and if you consider transparency then there are 4,294,967,296 possible combinations.

    Finding the most prominent colour even for a single image is not straightforward.

  • I would rather use loadPixels() and the pixels[] array, faster than get().

    And perhaps you can subdivide the color cube in large chunks (like red between 100 and 120, etc.), to get dominant colors.

Sign In or Register to comment.