Questions tagged [wand]

The ctypes-based simple ImageMagick binding for Python.

Wand is a ctypes-based simple ImageMagick binding library for Python. It works on Python 2.7, 3.2 through 3.9 and PyPy.

Docs

Community

383 questions
0
votes
1 answer

convert ImageMagick command line argument to Wand

I'm wondering how to convert this working command line sequence for ImageMagick into a Python script using the Wand library: convert test.gif -fuzz 5% -layers Optimize test5.gif Python code is: from wand.api import library from wand.color import…
0
votes
1 answer

prevent black and white image auto convert to grayscale image

Start from ImageMagick 6.8, it will auto convert a black and white image(RGB) to be grayscale, which will make the altered image to be lighter than the original one. In ImageMagick 6.9, we can turn this feature off by using the command "-set…
0
votes
0 answers

Python WAND can't change increment on filename

When I convert PDF to JPG using wand, I want the name to start at 001 instead of 000. So I have the following lines : with Img(filename=pdfName, resolution=self.resolution) as pic: library.MagickResetIterator(pic.wand) pic.scene = 1 # Start…
Nathan Cheval
  • 773
  • 2
  • 7
  • 32
0
votes
0 answers

wand.exceptions.MissingDelegateError: no decode delegate for this image format `' @ error/constitute.c/ReadImage/562

Hello i am using python in combination with imagemagick to convert an pdf to a image (jpeg). I installed ImageMagick and the Python Wand module. when i run the script in Windows 10 it runs perfectly but when i run it under Ubuntu 20.xx i get the…
Erik hoeven
  • 1,442
  • 6
  • 26
  • 41
0
votes
1 answer

wand.Image object to PIL Image

I currently have an image in the wand.image format. I need to convert it to PIL format so that I can continue working with it. It is and RGB image. I cant seem to find anywhere how to do it. I have tried to convert it to an np array and then read…
0
votes
1 answer

Output of connected-components different between ImageMagick and Wand?

I'm trying to get the coordinates of colors using connected-components feature under Windows10 with Python 3.8.5 ImageMagick 7.0.10-29 Q8 x64 2020-09-05 Using ImageMagick with the following command I get the coordinates correctly. >convert…
Ger Cas
  • 2,188
  • 2
  • 18
  • 45
0
votes
0 answers

Error trying to use connected-components with Wand and ImageMagick 6

I'm trying to use connected-components feature in python3.8 (64 bit) script with ImageMagick 6, but I receive error saying I need to install ImageMagick 7.0.8 or greater. Then I tried using latest ImageMagick 7.0.10 and when try to import "Image"…
Ger Cas
  • 2,188
  • 2
  • 18
  • 45
0
votes
2 answers

How to convert image areas to white or transparent?

I'm trying convert to white or transparent some rectangles areas within the below image. I'm able to make it with ImageMagick with the following command, that first makes transparent desired colors and finally convert to black the rest with…
Ger Cas
  • 2,188
  • 2
  • 18
  • 45
0
votes
1 answer

Wand can not set image resolution right

I'm trying to create a new jpeg image with resolution 300dpi. with Image(width=300, height=300, background=Color('white'), units = 'pixelsperinch', resolution=(300,300)) as ImgBackground: ImgBackground.save(filename='ImgOut.jpg') But the…
CrazyTR
  • 1
  • 1
0
votes
1 answer

Wand load only first page from blob

I'm loading my images from a blob and I would like to load only the first page. I know this is possible with the [0] syntax when it is in a file but is there a way to do that without writing my image to the disk? Thanks
Christo S. Christov
  • 2,268
  • 3
  • 32
  • 57
0
votes
1 answer

PDF to Image and downloading it to a specific folder using Wand Python

I am trying to convert all the pages of a PDF to images and save them to a specific working directory. The code is: from wand.image import Image from wand.image import Image as wi pdf = wi(filename="work.pdf", resolution=300) pdfimage =…
0
votes
1 answer

Python/Wand image.save() hangs if called several times

Working on Python code to read the contents of periodically changed file (information on an MP3) and create a specific animated gif based on the information at hand, using Wand. I have however been having a significant problem with the gif refusing…
0
votes
0 answers

wand.exceptions.WandRuntimeError in wand

When I am running my flask app using Nginx it works fine. But when I am using gunicorn and Nginx to deploy with real ip then it shows this problem. Ghostscript version is GPL Ghostscript 9.26 and ImageMagick version is ImageMagick 6.9.7-4 Q16…
0
votes
1 answer

Python Wand error when trying to display simple empty image: 'no encode delegate for this image format'

I'm new to Wand, I tried the following very simple code, to display a red image: from wand.color import Color import wand.display with Image(width=100, height=100, background=Color("red")) as img: wand.display.display(img) But I'm getting…
Sagi Mann
  • 2,967
  • 6
  • 39
  • 72
0
votes
1 answer

Python Wand - Crop to ratio?

With Imagemagick you could simply do: convert in.png -crop 16:9 out.png At first, I thought Image.transform(crop="16:9") would do the job, but it just resizes the image to 16x9 pixels, but using aspect ratio in resizing works just fine for some…
cheb
  • 1