← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #205371]: One image, multiple sizes?

 

Question #205371 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/205371

RaiMan posted a new comment:
All this is possible with Sikuli right now.

Since you always make Sikuli workflows with detailed knowledge about the
GUI elements and their behavior, the image based risk , that your script
fails, is normally due to rendering differences including scaling and
differences in the environment setup, that might influence the
appearence of your GUI elements.

In all these cases, where an image might have a different shape in
pixels (width x height) or the image content is different, so that the
Sikuli search cannot find the image any more, you need different image
sets for these situations.

For the first case (different size in pixels) it is rather easy to implement your solution based on one image set, that represents the images in its largest possible version. 
One of these images is prepared in different sizes, so your workflow would find out, which size is the current one. Now you could scale down all other images on the fly with this scale factor. The only caveat: your scaling approach must fit the one, that is used by the GUI.

I do not think, that you will get a general Sikuli feature for that in
the near future, since this would be very system and application/browser
dependent.

What might be a feature, that could be implemented rather easy: a
function, that scales down an image with a given factor and a choice of
the scaling algorithm from those mostly used. This could be an
additional aspect of the Pattern class.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.