Data Cyclist
Data Cyclist

Reputation: 31

Converting imagemagick command line to Wand (python)- printing deskew

I am having trouble converting the following command-line to Wand.

convert img.png -deskew 80% -print "%[deskew:angle]" null:

I was able to locate the deskew method in Wand but I want to store the amount of deskew.

Upvotes: 0

Views: 248

Answers (1)

emcconville
emcconville

Reputation: 24419

You would use the Image.artifacts dict.

from wand.image import Image

with Image(filename='rose:') as img:
    img.deskew(0.8 * img.quantum_range)  # 80%
    angle = float(img.artifacts['deskew:angle'])

Upvotes: 2

Related Questions