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
0 answers

Very low FPS on a Rpi 4B (2.7G RAM dedicated for GPU) with wand (ImageMagick) video processing

So I am getting VERY low FPS on the raspberry pi 4B when I modify live footage from a webcam to a 'barrel' effect using wand image processing. How can I fix this issue, if possible within the restraints of the hardware? I have a 4GB RAM Rpi 4B. If…
blevlabs
  • 11
  • 3
0
votes
1 answer

How to make auto-sizing boxes in images for text to remain same font size in Python with Wand

I'm utilizing Wand in python in order to create an image that iterates over itself so that it can create black-bordered boxes that populate with text. Here is my current code: import re from unicodedata import normalize from docx import…
Jimmy Wede
  • 107
  • 1
  • 7
0
votes
1 answer

How to use MagickImage/Wand to create an image comprised of equally spaced bordered boxes of text in Python

I need to make an image that looks like the following: To do so, I've implemented the use of MagickImage/Wand. Here is my current implementation import re from unicodedata import normalize from docx import Document from wand.image import…
Jimmy Wede
  • 107
  • 1
  • 7
0
votes
0 answers

Python WAND output incomplete

I have an issue with Wand and PDF to JPG conversion. For somes files, I'll have very large output. Also, the conversion doesn't convert all the PDF pages. I didn't have any errors. Here is my piece of code : with…
Nathan Cheval
  • 773
  • 2
  • 7
  • 32
0
votes
1 answer

Python Wand missing libraries/paths

I am trying to install Wand for Python 3, which for me is accessed through my Cygwin installation. I first tried installing Wand: # Install Wand #-------------- # https://docs.wand-py.org/en/0.6.6/guide/install.html $ python -m pip install…
user36800
  • 2,019
  • 2
  • 19
  • 34
0
votes
0 answers

Bundling ImageMagick in py2app

I am trying to make a py2app that uses Imagemagick from wand.image import Image The import works fine on my machine, but causes the following error when trying to launch the app on others: Traceback (most recent call last):   File "wand/api.pyc",…
0
votes
0 answers

PDF file reading using wand image error : wand.exceptions.DelegateError

I want to write a python code that reads a pdf file and convert it to images following this tutorial : https://www.youtube.com/watch?v=pf7OONW7l54 and https://www.youtube.com/watch?v=jRUcMiXZt5Q so wile writing this part of the code : import io…
eya_bklt
  • 305
  • 3
  • 10
0
votes
1 answer

Convert ImageMagick command to Wand Python

I'm wondering how to convert this working command line sequence from ImageMagick into a Python script using the Wand library: /usr/local/bin/convert pic.png -alpha off +dither -colors 2 -colorspace gray -normalize -statistic median 1x200 -negate…
JulienD
  • 35
  • 5
0
votes
1 answer

How to disable OpenCL with wand in python

So I'm using wand for a project and it's been working fine, except whenever I want to use a function that has been 'OpenCL-accelerated' (list of functions here), it stops working, no error or anything, but I'm pretty sure that OpenCL is what's…
Judev1
  • 434
  • 3
  • 11
0
votes
0 answers

how to resolve the ArgumentError: argument 2: : wrong type in tkinter askopenfile

I want to make a tkinter gui to convert pdf page into image. I tried this: root = Tk() def open_file(): global file file = askopenfile(mode ='rb', filetypes =[('pdf files', '*.pdf')]) print('Selected:', file) def pdftoimage(): …
ras ku
  • 33
  • 8
0
votes
1 answer

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.
Data Cyclist
  • 21
  • 1
  • 3
0
votes
1 answer

How to create Photoshop Layers with Names in Wand 0.6.5

I am looking for an example to create an image with python ImageMagic Wand with named layers. How do you set the Layer names for a photoshop (PSD) file? ```# Create Image (Layer0) with Image( width=int(configuration['layer0']['width']), …
0
votes
1 answer

Wand/ImageMagick compare method always returns same float number

The documentation for Wand, says that the Image.compare method returns a tuple containing the difference image and a integral number representating the difference between these. The problem is that this number always returns a float with the value…
Mojimi
  • 2,561
  • 9
  • 52
  • 116
0
votes
1 answer

Is it possible to use multiple fonts in Python Wand (Drawing Caption)?

I am using the following in Wand with Image(width=width, height=height) as canvas: left, top, width, height = 53, 247, 918, 78 with Drawing() as context: context.fill_color = 'transparent' …
user3572565
  • 754
  • 7
  • 15
0
votes
0 answers

WAND exceptions after writing pdf with PyPDF4

I need to add a function that remove blank pages from PDF. I have the following piece of code : def remove_blank_page(self, file, config, ocr, files): tmp_folder = tempfile.mkdtemp(dir=config.cfg['GLOBAL']['tmppath'], prefix='blank_detection_') …
Nathan Cheval
  • 773
  • 2
  • 7
  • 32