SikuliX IDE - Get Pixels

Asked by Javier Gonzales Rodriguez

Hello there,

I already tried/read about importing "PIL, Image" from sikuliX IDE.

Does anyone knows how to get pixels from an image using jython/SikuliX IDE?

I made an update to my jython to the latest "2.7.2" and am using ubuntu 20.04

Thanks, regards!

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

PIL does not work with Jython (C-based).

SikuliX has a (secret ;-) feature Location.getColor(), which returns a Java object Color.

How to get the color information from that object, look at the java docs:
https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/Color.html

In SikuliX scripts you principally can use any Java classes.

You might find a suitable Java library, put it on the class path at runtime and use it.
https://jython.readthedocs.io/en/latest/JythonAndJavaIntegration/

Revision history for this message
Javier Gonzales Rodriguez (stonegarden21) said :
#2

Thanks RaiMan, that solved my question.