Questions tagged [pythonmagick]

PythonMagick is a Python library that provides object oriented bindings for the ImageMagick Library.

PythonMagick is a Python library that provides object oriented bindings for the ImageMagick Library.

ImageMagick is a free software suite to create, edit, and compose bitmap images. It can read, convert and write images in a large variety of formats. Images can be cropped, colors can be changed, various effects can be applied, images can be rotated and combined, and text, lines, polygons, ellipses and Bézier curves can be added to images and stretched and rotated.

43 questions
11
votes
1 answer

PythonMagick can't find my pdf files

I've downloaded and installed PythonMagick for python 2.7, 64 bit Windows 7, from the Unofficial Windows Binaries. I am trying to run this code (Processor.py) import PythonMagick pdf = 'test.pdf' p = PythonMagick.Image() …
Anti Earth
  • 4,671
  • 13
  • 52
  • 83
10
votes
2 answers

Resize GIF animation, pil/imagemagick, python

I want to change size of GIF animation image using python and PIL or PythonMagick. I can't find solution. PIL and thumbnail method works for jpg and png but not for gif. ImageMagick has command mogrify/convert -resize '1280x1024>' but i can't find…
eshlox
  • 766
  • 2
  • 11
  • 22
8
votes
1 answer

With Python`s PIL, how to set DPI before loading an image?

I was trying to use PIL to open an (Illustrator) .eps-file, do some changes and save it. I want to set the document to 300 dpi, and color mode to cmyk before opening, creating or interpreting the object. First I tried the same with PythonMagick and…
6
votes
3 answers

How to handle multi-page images in PythonMagick?

I want to convert some multi-pages .tif or .pdf files to individual .png images. From command line (using ImageMagick) I just do: convert multi_page.pdf file_out.png And I get all the pages as individual images (file_out-0.png, file_out-1.png,…
Tickon
  • 1,058
  • 1
  • 16
  • 25
4
votes
0 answers

PDF to Image conversion in Python 3.6.5 : Issue setting dpi in PythonMagick

I am not able to set the dpi of an Image object. The last line in the code is always throwing me an error message.. please see below : import PythonMagick from PythonMagick import Image p = PythonMagick.Image() p.density('300') # --> This…
RRaj
  • 41
  • 2
3
votes
2 answers

Montage using PythonMagick in Python 3?

I was hoping to be able to generate montages using PythonMagick. The documentation seems very sparse, but I've been trying to hunt it down using the code completion part of Eclipse at least, as well as a few other questions' suggestions here on…
Mylan Connolly
  • 494
  • 1
  • 5
  • 15
3
votes
1 answer

PythonMagick ColorSpace type

I tried: from PythonMagick import Image img = Image("input.jpg") img.quantizeColorSpace("sRGB") And get: Traceback (most recent call last): File... img.quantizeColorSpace("sRGB") Boost.Python.ArgumentError: Python argument types in …
Ivan Zelenskyy
  • 659
  • 9
  • 26
2
votes
1 answer

How can the EXIF orientation tag be changed (preferably using PythonMagick)?

I'm scaling and rotating some JPEGs using PythonMagick. Ideally, I could update the EXIF Orientation tag as well. However, while I can retrieve the value of this tag, I can't seem to modify it. Consider: from PythonMagick import Image i =…
Jean-Paul Calderone
  • 47,755
  • 6
  • 94
  • 122
2
votes
2 answers

Losing quality of image while changing from pdf to image using PythonMagick

I am working on changing pdfs to images using PythonMagick. I am successfully changing the formats, but the quality of the image is diminished during this process. This is the code that i am…
Harsha Jasti
  • 1,114
  • 1
  • 9
  • 25
2
votes
1 answer

How to make transparent background white instead of black when converting PDF to JPG using PythonMagick

I'm trying to convert from PDF to JPG using PythonMagick, but I can't find a way to set the background color, which by default is changed from transparent to black. I can get the desired result using os.system and the -flatten parameter as shown…
Joar Leth
  • 691
  • 9
  • 27
2
votes
1 answer

Set sampling algo

Im trying to create a thumbnail from a jpg image using PythonMagick: img.quality(90) # TODO set the sampling algo e.g. bilinear img.sample(Geometry(scaledWid, scaledHei)) img.crop(Geometry(THUMBNAIL_WID-1, THUMBNAIL_HEI-1,cropLeft,…
user1724763
2
votes
1 answer

PythonMagic: How do a composite with a dissolve value?

I like to do this with PythonMagick: composite -dissolve 40 over.png base.png new.png I have tried: import PythonMagick base = PythonMagick.Image("base.png") over =…
t777
  • 3,099
  • 8
  • 35
  • 53
2
votes
1 answer

Python, process animated gif preserving animation parameters

Is that possible to process (expand, add background and some text "below" the original image) animated gif in Python? I believe I should process each frame separately (which is a bit of performance issue, but still better than nothing) yet I can't…
migajek
  • 8,524
  • 15
  • 77
  • 116
1
vote
1 answer

Convert TIFF to PNG module object is not callable

I am trying to convert TIFF to PNG using PythonMagick and this is the code from PythonMagick import Image from PIL import Image sImage = 'MySample.tiff' sOutput = 'MyOutput.png' sCropped = 'Cropped.png' def crop(img, image_path, coords,…
YasserKhalil
  • 9,138
  • 7
  • 36
  • 95
1
vote
2 answers

Getting ModuleNotFoundError: No module named 'PythonMagick' in Python

I am trying to import PythonMagick but not able to import this module. Could you please help me how to install it and use it in my code? I tried several methods- python -m pip install PythonMagic python -m pip install PythonMagic --user I…
Shivika Patel
  • 213
  • 1
  • 5
  • 14
1
2 3