← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #291440]: difference between my screenshot and what sikuli searches?

 

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

RaiMan proposed the following answer:
Just tested on my MacBook Pro with Retina and OSX 10.11.4:
- Mac shortcut (shift-cmd-4) produces an image, whose width and height is doubled (as expected with Retina)
- using the feature Image.resize(0.5) yields an Image, that is found by SikuliX

my test script:

switchApp("Safari")
wait(1)
setFindFailedResponse(PROMPT)
addImagePath("/Users/raimundhocke/SikuliX/Images")
testLogoSX = "testLogoSX.png" # captured with IDE
print "SX capture: %s" % (exists(testLogoSX, 0))
# found

print "Mac capture: %s" % (exists("testLogo.png", 0)) # captured with mac shortcut
# not found

# resize image (w * 0.5, h * 0.5)
testLogo = Image.create("testLogo.png")
print testLogo
testLogo = Image(testLogo.resize(0.5))
print testLogo
print "capture resized: %s" % (exists(testLogo, 0)) # using the resized image
# found

Later I will check with an attached non-Retina display.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.