SikuliX IDE - Get Pixels

Asked by Javier Gonzales Rodriguez on 2020-12-17

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:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2020-12-18
Last query:
2020-12-18
Last reply:
2020-12-17
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/

Thanks RaiMan, that solved my question.