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

Python change cpt on save with Wand

I have the following function to convert PDF to images : from wand.image import Image as Img with Img(filename=pdfName, resolution=self.resolution) as pic: pic.compression_quality = self.compressionQuality pic.background_color =…
Nathan30
  • 689
  • 2
  • 8
  • 29
0
votes
1 answer

Resizing is blurry

Windows 10 ImageMagick 7.0.10-12 Q16x64 2020-05-15 Wand 0.6.1 I do: i.resize(width=new_width, height=new_heigh, filter='triangle', blur=-1) Result: blurry with the comparable image size. Say, original width is 640, new width is 610. Filter and blur…
Michael
  • 4,273
  • 3
  • 40
  • 69
0
votes
1 answer

Convert from PPM P3 to PPM P6 and back using Python Wand

I was originally trying to use Python Pillow to convert a ppm p3 image to jpg, png, etc, when I realized that Pillow only allows ppm p6. I've tried a whole bunch of ways to solve this problem, but I haven't found a solution. I discovered that using…
0
votes
0 answers

Importing modules works on Shell but not on the Interpreter

I'm trying to use the module Wand and when I import it from shell it works just fine. But when I try to use it on my IDE (PyCharm) it simply says there's no such module. I have no idea why. $ python >>> import wand But on the IDE, if I try to…
0
votes
1 answer

Python executable file - wand module not found

I have a written a piece of code in python and everything works fine when I run it in Pycharm. So I tried to create an executable file from my code using pyinstaller. the .exe file is being created however when I run the .exe file, an error pops…
0
votes
1 answer

Problems Converting Numpy/OpenCV Array Image into a Wand Image

I'm currently trying to perform a Polar to Cartesian Coordinate Image transformation, to display a raw sonar image into a 'fan-display'. Initially I have a Numpy Array image of type np.float64, that can be seen below: After doing some searching, I…
Nicholas Sadjoli
  • 375
  • 1
  • 3
  • 11
0
votes
0 answers

Python WAND resize poor quality

I have the following code to extract PDF to JPG. I had to resize the img because of the large size, I loose the PDF original format (A4, A3 etc..) : with Img(filename=pdfName, resolution=self.resolution) as document: reader =…
Nathan Cheval
  • 773
  • 2
  • 7
  • 32
0
votes
1 answer

Unable to use parameters with pango while calling wand.image.Image.pseudo method to draw text

I am new to drawing text over an image. I am trying to draw emojis and non-english characters (e.g. Russian, Greek, Arabic etc.) using wand.image.Image.pseudo method in a python script. In this method, I am passing pango command as value for pseudo…
0
votes
1 answer

Using **wand** to reduce image filesize for improved OCR performance?

I'm trying to write use the wand simple MagickWand API binding for Python to extract pages from a PDF, stitch them together into a single longer ("taller") image, and pass that image to Google Cloud Vision for OCR Text Detection. I keep running up…
Brian
  • 53
  • 6
0
votes
0 answers

Wand Python and left over Image Magick files

My Python script converts PDF files in images to be used in PyTesseract: def images(inputFile): pdfFile = wi(filename = inputFile, resolution=600) formato = 'png' image = pdfFile.convert(formato) pag = 0 dfs = [] for img…
Marcelo Gazzola
  • 907
  • 12
  • 28
0
votes
0 answers

who I can use python3 and wnad to convert pdf to png

good night, I read that I can convert every page of a pdf document in a different image and for that I could use wand do U have any ideia how I can do that I alredy tried to see in the documentation but I didn't understood anything :( I appreciate…
user11202747
0
votes
2 answers

How to avoid creating mipmaps for dds using python Wand?

Env: python - 3.6.6 Wand - 0.5.7 Code example: Part of this file from wand import image with image.Image(filename='example_32_on_32_px.png') as img: img.compression = 'dxt3' img.save(filename='output.dds') It will produce output.dds which…
Yuriy Leonov
  • 536
  • 1
  • 9
  • 33
0
votes
1 answer

Affine transformation with 3 points and merging images

I am writing a Python program that shows 2 thermal (low res) drone shots next to each other. The user then chooses 3 points on both pictures after which the second picture should be transformed and merged with the first. The following step the…
Jan-Pieter
  • 137
  • 2
  • 10
0
votes
1 answer

Problem applying transformation on tiff images using wand

I am using wand package to convert a pdf file to tif file. I called Image. transform function to resize the image. Below is the code snippet with Image(filename='sample.pdf') as img: img.format='TIF' img.transform('50%') …
Yuyeyuan
  • 1
  • 1
0
votes
1 answer

Using Wand gives 'MagickCompareImagesLayers' not found Error

I am trying to use ImageMagick in Python3.7 using Wand binding. I have successfully installed ImageMagick & Wand(pip install, version: 0.5.7) But I'm constantly getting the error that says: 'AttributeError: function 'MagickCompareImagesLayers' not…
Suryakant
  • 19
  • 3