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
4
votes
1 answer

Good python module to draw on images

I'm working on a Python project and I'm looking for a nice module to do the following : Draw some bezier curves, on an existing JPEG image, from a given list of points. Then use this image to present it in a PDF. I have to be able to draw shapes,…
Kyrill
  • 227
  • 1
  • 11
4
votes
1 answer

Python Wand how to resize keeping aspect ratio and filling in the remaining space with an transparency

I am trying to resize an image with python Wand preserving the aspect ratio and filling in the remaining location with a transparency. For example I would like to resize an large rectangle down to fit within 100x100 image while keeping the aspect…
Baracs
  • 139
  • 1
  • 6
4
votes
1 answer

Composition Masking using Python Wand

I am trying to implement the following ImageMagick command using Python Wand: convert red_image.png green_image.png write_mask.png -composite masked_composite.png Here's the example of it in images: Any hints? UPDATE: Here's my solution if…
4
votes
2 answers

Wand convert pdf to jpeg and storing pages in file-like objects

I am trying to convert a pdf to jpegs using wand, but when I iterate over the SingleImages in image.sequence and save each image separately. I am saving each image on AWS, with database references, using Django. image_pdf =…
yarbelk
  • 7,215
  • 6
  • 29
  • 37
4
votes
1 answer

Writing animated gif using Wand and ImageMagick

I'm having trouble figuring out how to write a basic sequence to an animated gif using Wand the ImageMagick binding. The basic convert ImageMagick commands I'm looking to reproduce in python: convert -delay 50 -size 500x500 xc:SkyBlue \ …
jkeilson
  • 85
  • 1
  • 6
3
votes
2 answers

how to convert a numpy array into a wand.image.Image object?

I want to save a numpy array as a .dds file, here is how i got the array: import numpy as np from wand import image with image.Image(filename='test.dds') as dds: arr = np.array(dds) after i got the array, i need to save it as another .dds file…
xiaojifeng
  • 45
  • 3
3
votes
3 answers

Converting PDF to Image without non-python dependencies

I want to create an exe that can be deployed onto other computers. The program needs to be able to read pdf's and turn them into images, but I don't want other users to have to download dependencies. My understanding is that py2image and wand both…
3
votes
2 answers

Wand python get pixel color with GIF

I want get rgb color some pixel in gif from wand.image import Image with Image(blob=img, format='JPG') as picture: print picture[1][1].string # return srgb(0,0,0) is good Problem: from wand.image import Image with Image(blob=img,…
3
votes
1 answer

Can't load PDF with Wand/ImageMagick in Google Cloud Function

Trying to load a PDF from the local file system and getting a "not authorized" error. "File "/env/local/lib/python3.7/site-packages/wand/image.py", line 4896, in read self.raise_exception() File…
timhj
  • 497
  • 4
  • 14
3
votes
1 answer

Python Wand PDF to List of Images TypeError

I'm trying to make a python program that takes a PDF and converts it to a list of images, but I'm getting the issue: TypeError: object of type 'NoneType' has no len() Python from wand.image import Image as Ima images = [] pdf =…
Lxs29
  • 165
  • 1
  • 2
  • 13
3
votes
1 answer

ImageMagick - Convert image RGB to CMYK using ICC in Python

Is there any way to convert an RGB image into a CMYK one using ICC in a python ImageMagick binding. I know you can easily do it in the command-line, but is there anyway to do it in a binding like Wand (preferably Wand)? What I have now is: from…
pepper5319
  • 667
  • 4
  • 8
  • 24
3
votes
1 answer

How does joblib Parallel function manage the memory?

I am writing a function to convert PDF to PNG images, it looks like this: import os from wand.image import Image def convert_pdf(filename, resolution): with Image(filename=filename, resolution=resolution) as img: pages_dir =…
3
votes
3 answers

Convert pyplot figure into wand.image Image

Is there a way to convert a pyplot figure created with pyplot.Figure into a wand image? I have tried using the following to no avail: image_data = BytesIO() figure.savefig(image_data, format='png') image_data.seek(0) image = Image(file=image_data,…
dlwlrma
  • 99
  • 2
  • 13
3
votes
1 answer

Python Wand change tiff to min-is-white

I need to convert files to tiff where photometric is set "min-is-white" (white is zero) to comply with the required standards. I'm using Wand to interact with Photomagick but every I save a bilevel tiff file, it creates a min-is-black. How can I get…
loneraver
  • 1,282
  • 2
  • 15
  • 22
3
votes
3 answers

Importing Wand in Python Ubuntu 14.04

I'm fairly new to Ubuntu, Python and have never used imported anything in Python before. My Ubuntu system has Python2.7, 3 and 3.4 installed. I'm trying to start working with Wand for an assignment. Using this documentation from Wand website I…
chautob0t
  • 117
  • 1
  • 3
  • 13