glitchassassin / lackey

Lackey - Graphical desktop automation with Python
MIT License
616 stars 75 forks source link

Retina device support? #141

Closed genequ closed 5 years ago

genequ commented 5 years ago

macOS 10.12, Lackey 0.7.3

Seems the find()/exists() always fails when the image is captured from a retina Mac ( CMD+SHIFT+4). lackey.Exceptions.FindFailed: Could not find pattern 'icon.png'

Does it officially support retina Mac?

genequ commented 5 years ago

Seems Sikulix will downscale(?) the image captured from IDE, https://answers.launchpad.net/sikuli/+question/661470

RaiMan commented 5 years ago

@genequ SikuliX does nothing like downscale of images. Since it is based on Java, the capturing with the Java Robot works against Retina displays since Java 8: internally automatically downscaled with factor 0.5. Still it is a problem with SikuliX also, if you want to use images captured with CMD+SHIFT+4. Those images have to be manually downscaled before using them with SikuliX. Or you might use the SikuliX feature resize(), to do the scaling in a script before using those images. For SikuliX users it is recommended anyways, to do any capturing with the SikuliX features (IDE or programmatically). For Retina images to be used in Lackey: if captured with CMD+SHIFT+4, you have to downscale them manually (e.g. with Preview) with the factor 0.5 or programmatically using relevant OpenCV features.

RaiMan (SikuliX developer)

genequ commented 5 years ago

@RaiMan Thanks!