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
26
votes
3 answers

Wand Policy Error: error/constitute.c/ReadImage/412

I am facing the issue while converting pdf to image using Wand: E wand.exceptions.PolicyError: not authorized `/opt/sample.pdf' @ error/constitute.c/ReadImage/412 I have already visited the previous stack overflow question…
Prakash Kumar
  • 2,554
  • 2
  • 18
  • 28
23
votes
4 answers

Convert PNG to SVG using python

Is there way to convert a png file into SVG file using only pure python or a python module such as wand? To be more precise, I want to convert a png into a real vector graphics, I don't want to embed a bitmap inside the svg, I want to convert into…
marco
  • 915
  • 4
  • 17
  • 35
21
votes
5 answers

Python Wand convert PDF to PNG disable transparent (alpha_channel)

I'm trying to convert a PDF to PNG - this all works fine, however, the output image is still transparent even when I believe I have disabled it: with Image(filename='sample.pdf', resolution=300) as img: img.background_color = Color("white") …
Munro
  • 269
  • 1
  • 3
  • 4
21
votes
1 answer

Improve quality of Wand conversion

I convert files of different formats (JPEG, PNG, TIFF, PDF) to JPEG using Wand, a ctypes-based ImageMagick binding for Python. The resulting files are very low-quality. If there is text in original file, it becomes almost unreadable in the resulting…
Mirzhan Irkegulov
  • 17,660
  • 12
  • 105
  • 166
15
votes
5 answers

python wand.image is not recognized

I installed Imagemagic (both 32 and 64 bits versions were tried) and then used pip to install wand, I also set the Magick_Home env. variable to imagemagic address but when I run Traceback (most recent call last): File "", line 1, in…
c.Parsi
  • 771
  • 2
  • 9
  • 26
12
votes
4 answers

How to convert multipage PDF to list of image objects in Python?

I'd like to turn a multipage PDF document into a series of image object in list structure, without saving the images in disk (I'd like to process them with PIL Image)in Python. So far I can only do this to write the images into files first: from…
Hendrik
  • 1,158
  • 4
  • 15
  • 30
11
votes
1 answer

Python binding to ImageMagick

I am looking for a good Python binding to ImageMagick, but there seem a lot of bindings already. I am not sure that which of these is the right tool for my job. Can you guys recommend me one? Here is the list of my requirements and preferences (in…
minhee
  • 5,688
  • 5
  • 43
  • 81
11
votes
1 answer

How do I create an animated gif in Python using Wand?

The instructions are simple enough in the Wand docs for reading a sequenced image (e.g. animated gif, icon file, etc.): >>> from wand.image import Image >>> with Image(filename='sequence-animation.gif') as image: ... len(image.sequence) ...but…
Dominick
  • 437
  • 5
  • 16
11
votes
5 answers

Python doesn't find MagickWand Libraries (despite correct location?)

I wanted to install the Python ImageMagick API wand and followed this site: http://docs.wand-py.org/en/latest/guide/install.html#install-imagemagick-on-windows However, when running a very simple test: from wand.image import Image I get the…
userrr3
  • 483
  • 1
  • 5
  • 12
10
votes
2 answers

PyCharm issue with runserver command

I have a script, part of a Django app, that makes thumbnails from pdfs. I'm using the excellent wand package to do it: Here are the Wand docs It runs fine if I do ./manage.py runserver from the command line, but if I run from PyCharm, it…
Rob L
  • 3,634
  • 2
  • 19
  • 38
10
votes
1 answer

Python Wand generates lots of temporary files

We use Python Wand under Celery to process a lot of pictures. On some of our servers, our treatment sometimes leaves a lot of temporary files behind, e.g.: $ ls -lh /tmp/ -rw------- 1 ubuntu ubuntu 1.9M Apr 1 04:35 magick-y1yKKiVZ -rw------- 1…
analogue
  • 3,160
  • 1
  • 21
  • 27
10
votes
2 answers

Use python wand to grayscale image

I want to use the Python API binding for ImageMagick http://wand-py.org to directly manipulate images. I am however not able to deduce from the documentation how to use a grayscale transformation. Can anybody provide information on this…
user2075719
  • 111
  • 1
  • 6
10
votes
2 answers

Compositing two images with python wand

I need to use python wand (image-magick bindings for python) to create a composite image, but I'm having some trouble figuring out how to do anything other than simply copy pasting the foreground image into the background image. What I want is,…
Alberto A
  • 1,160
  • 4
  • 17
  • 35
9
votes
1 answer

How to properly import Wand to python?

I am running into some issues when I try to import Wand (an ImageMagick binding for Python). Here's what's happening: from wand.image import Image getting the standard error message: ImportError: No module named wand.image Yes, Wand is installed,…
dimensive
  • 205
  • 2
  • 3
  • 5
9
votes
1 answer

no decode delegate for this image format `PNG'

I'm writing a django/python application and I need to convert PDF files uploaded by the user to JPEGs (files are scans) I'm trying to use wand, with an ImageMagick backend (on OSX) and I keep getting the following error: MissingDelegateError at…
1
2 3
25 26