How to get Pixel Color values as part of a bash script?
-
I was wondering if there is a linux command-line utility that could be called in a bash script to return a pixel color value that could then be used as a variable in the script. I just want it from the screen in general, (i know how to take values from stored images...) I'm hoping that there exists a cleverer solution than taking an image of the screen and processing that, as it needs to work fairly quickly. (i'm writing a script to survey the range of colors displayed by pixels over a given period of time, and activity, in order to settle a bet...long story...) I'd like to stick with utilities that can be used in a bash script, because i've already written the activity tracking part in bash, and i don't want to port to a different language if i can help it. Ideally somebody knows about a simple library written for the terminal with a command like: getpixelcolor( x, y ) that could be called as part of a loop and would return a numeric color value in some usable format format. Also, I could probably write my own utility if I could find out how to get raw color information from the graphics drivers....I'm using an Nvidia 6800gt with Ubuntu 9.04 via gnome. (i don't know anything about driver operation... Any help would be greatly appreciated, and I apologize for being technically vague. If i knew exactly what I was talking about, I wouldn't need to ask the question =)
-
Answer:
I would look into the code of whatever is being called when you hit the screen capture button. It has to have some way of capturing the display to work. To what little I know about these sorts of things, this function seems like something that would more likely be found in a graphics library than a dedicated utility.
Jason Bourne at Yahoo! Answers Visit the source
Related Q & A:
- How to deploy a server script?Best solution by Stack Overflow
- How to call a function with parameter in a bash script?Best solution by tldp.org
- How do you submit a movie script?Best solution by Yahoo! Answers
- How to start creating a php script, that will be installed on many servers?Best solution by Stack Overflow
- How do I print green color if I will use a yellow color paper?Best solution by ehow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.