← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #237477]: how to crop image in Sikuli?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
You can capture only the relevant region, like this:
img = capture(x, y, w, h)

or 
img = capture(some_region)

img contains the file name in temp storage

- if you want to save the image
import shutil
shutil.move(img, "absolute-path-to-saved-image.png")

few basic image manipulation features (like cropping) are planned for
version 1.1

--- Forgot to mention that the local area-of-interest are in fixed regions, so Finder is not ideal for this job also.
I do not understand?

# some_region must have both width and height equal or greater than those of reference_image
img = capture(some_region)
f = Finder(img)
f.find(Pattern(reference_image).exact())
if f.hasNext():
    print "equal"
else:
    print "not equal"

the version 1.1 will have a feature to compare 2 images

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