Sikuli script not works when change from laptop monitor to dual monitors

Asked by Mattias Andersson

Hi,

1. I did my Sikuli script on a laptop
2. I dock my laptop and now using two external monitors
3. When i start the script, it not finding the image anymore?

Why does this happen? Is there an easy way to fix this?

Laptop
Resolution 1440 x 900

External monitors
Resolution 1920 x 1080

Best Regards
Mattias

Question information

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

The resolution ratio on the laptop is 0.625.

On the monitors, the resolution should be 1920 x 1200 for the same ratio.
But it is 0,5625 (the width is slightly clinched).

So if your application reacts with different rendering behavior while showing the same content with respect to the screen, the relevant images have a width, that is reduced by 10%.

To let Sikuli find the same images on other systems with different monitor setups, the images must be the same pixel by pixel.

You might check this e.g. with the IDE's preview feature or any other screen capture tool, that allows to measure and have a look on the pixel level.

If this is the cause, you have to either change your monitor setup or use a different set of images for each differing situation.

If this is not the case: any chance to put screenshots somewhere in the net (e.g. dropbox)?

Revision history for this message
Kannan (umeshmsmail) said :
#2

So what I understand from your answer is if I am changing from a small monitor to big one I have to manually change the resolution or take images in big monitor and run the script.Is this right?

Is there anyway we can overcome this using Sikuli itself?

Can we use Pattern class for this purpose?

Kannan

Revision history for this message
RaiMan (raimund-hocke) said :
#3

--- Sorry, then I did not talk clearly:

As long as the captured image on another system with a different monitor resolution is the same pixel per pixel (not rendered differently - not stretched or something like that), it should be found on the system.
So depending on the resolution, you might see it smaller or larger compared to the screen size, but it should be found if it is the same size in pixel (width x height) and the pixels have the same colors.

So if you capture system or application elements, whose appearance depend on some individual settings, that might differ from system to system, you will have problems with Sikuli.

--- Can we use Pattern class for this purpose?
currently not.
You would have to setup your own managing concept for that (e.g. image sets that are imported).

Can you help with this problem?

Provide an answer of your own, or ask Mattias Andersson for more information if necessary.

To post a message you must log in.