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

How to convert an uploaded file (InMemoryUploadedFile) from pdf to jpeg in Django using wand?

I'm trying to convert a pdf file uploaded in Django to a jpg file. I would like to use the file directly in the InMemoryUploadedFile state. I tried to use wand but without any success. Here is the code I wrote: from django.shortcuts import…
0
votes
0 answers

Incorrect date when saving image with python wand

I'm extracting a page from a PDF file and saving it as a JPG file with python. Things goes wrong when saving the image, the date is incorrect. from wand.image import Image path = 'C:\\Users\\Name\\Dropbox\\filename.pdf' with…
Jelmer
  • 351
  • 1
  • 15
0
votes
1 answer

How can I do a compose in wand?

I'm trying to create a composition of an image with wand but I'm not able to find the right way to do so. convert beijing_contrast.jpg beijing_blurmap.jpg \ -compose Blur -set option:compose:args 10 -composite \ …
Vinz
  • 45
  • 4
0
votes
0 answers

PDF to Image conversion using python Wand

I am using wand.image package to convert pdf into image file in Python 3 but I am getting an OS Error. I am not able to get around this OSError. Any help would be truly appreciated. import os from wand.image import Image as Img pdf =…
0
votes
1 answer

How to extract data from pdf image file with the coordinates?

How to extract text from PDF image file with in the coordinates, using python and with its external libraries. from wand.image import Image as wi from PIL import Image pdf = wi (filename=("F:\cng-example-bill.pdf") pdfImg =…
user2927486
  • 111
  • 2
  • 8
0
votes
1 answer

How do I use hdfs file with Wand for Image conversion using Pyspark - Hadoop HDP 2.6.6

I am trying to convert pdf files to Image and then use pytesseract to ocr the files. I was able to do it successfully on the files which are present in the linux local path but not with hdfs path. from wand.image import Image as wi >>>…
SVK
  • 1,004
  • 11
  • 25
0
votes
2 answers

Why using cv2.imread to read an image created by Wand from pdf file return all 255 for all RGB?

I am trying to identify blobs of text in a pdf file. So say for example, there are different sections in an academic paper, and I want to identify the title as a section, the authors and addresses as a section, and the abstract as a section. One…
Kay
  • 59
  • 1
  • 5
0
votes
1 answer

edit XML file in terminal

I have a server running on Linux system, and I want to edit an XML file of Imagemagick. The file content is: .. .. …
zaki
  • 127
  • 1
  • 10
0
votes
1 answer

Is there a way to trim transparent areas using Wand (the ImageMagick Python binding)?

The following code generates error. #!/usr/bin/env python import collections.abc from wand.image import Image, COMPOSITE_OPERATORS, DISTORTION_METHODS, CHANNELS from wand.drawing import Drawing wand_imageText = Image(width=1080, …
Coder1979
  • 107
  • 9
0
votes
1 answer

Slow opening of RAW files in wand

I'm using wand (MagickWand API bindings for Python) to generate thumbnails of Nikon raw images "file.nef". Here is part of the code: for arquivo in os.listdir(caminho): # Se arquivo termina com if arquivo.endswith(".NEF"): …
Ricardo
  • 11
  • 6
0
votes
0 answers

Image magick with python on windows giving CorruptImageError: unable to read image data

Hi I am facing issues while trying to convert PDF files to .jpeg I am running python from anaconda distribution on windows machine. Below is the code that is working for some of the pdfs import os from wand.image import Image as wi pdf_dir =…
kumarm
  • 79
  • 3
  • 15
0
votes
1 answer

write antialiased text with custom font on transparent image

so, as the topic says, I want to write some text on an transparent image. Or, to be more specific, I want to write on multiple specific positions different text. The point is, I want to use a custom font (coolvetica) and (and there is my problem) I…
0
votes
0 answers

Not all arguments converted during string formatting (Flask, ImageMagick and SQLAlchemy_ImageAttach)

I can't really make any sense of this error. When I try to commit a change to user.picture, it sends the error written in the title. I haven't been able to find any other example of this error occurring in anything related to this. Here's the…
Jertyu
  • 105
  • 8
0
votes
1 answer

Python wand makes huges tempfiles

What is wrong with my erroneous code? Wand making tempfiles and not delete them. I have try os.remove, but then I get error WindowsError: [Error 32]. What is wrong? name = "testname" fullFilename = "test" + "/" + str(name) + ".png" with…
mattias77
  • 13
  • 3
0
votes
1 answer

Should the use of subprocess.Popen and subprocess.call be avoided if possible?

I'm doing a project doing simple image processing and comparison through the use of ImageMagick Right now, to execute my commands I'm using the python subprocess module as such: color_space = ... evaluate_sequence = ... output_file_name =…