Imagemagick is open source software suite for displaying, converting, and editing raster image files. Wand is a ctypes-based ImageMagick binding for Python.
How do i get the list of image files, which i got as a result of using Wand?
For example there is a 2-page PDF file file.pdf
and i converted it to 2 JPEG files file-0.jpg
and file-1.jpg
. How do i get the list ['file-0.jpg', 'file-1.jpg']
?
Currently i simply use glob
:
with Image(filename='file.pdf') as original:
with original.clone() as converted:
converted.format = 'jpeg'
converted.save(filename='file.jpg')
images = glob('*.jpg')
But maybe there is a more idiomatic way through Wand library itself.