Which Python API?
Which Python API?
Hi Folks,
I've been using PerlMagic for a while now. However, I've recently been using Python for some (non-imaging) work, and would like to start using Python with ImageMagick.
There appears to be a number of different wrapper implementations, some of which do not appear to have been updated recently. I'm looking for something that will give full functionality of all the IM process and something that keeps up to date with all IM fixes.
Does anybody have any recommendations of which wrapper would be best for my requirements?
Ta
Mike
I've been using PerlMagic for a while now. However, I've recently been using Python for some (non-imaging) work, and would like to start using Python with ImageMagick.
There appears to be a number of different wrapper implementations, some of which do not appear to have been updated recently. I'm looking for something that will give full functionality of all the IM process and something that keeps up to date with all IM fixes.
Does anybody have any recommendations of which wrapper would be best for my requirements?
Ta
Mike
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Which Python API?
I am not an expert on ImageMagick bindings to Python. But from what I have seen from their documentation, Wand (http://docs.wand-py.org/en/0.4.4/) does a pretty good job. One thing that seems missing is dealing with profiles.
Also consider Imagemagick's Pythonmagick (http://www.imagemagick.org/download/python/). At least with the latter, you may be able to ask for features to be added if they are not there.
Another option is to use Python subprocess to make calls to ImageMagick directly.
Also consider Imagemagick's Pythonmagick (http://www.imagemagick.org/download/python/). At least with the latter, you may be able to ask for features to be added if they are not there.
Another option is to use Python subprocess to make calls to ImageMagick directly.
Re: Which Python API?
Thanks Fred,
I suspected this. Think I may stay with perl for the moment. Better the Devil you know
Mike
I suspected this. Think I may stay with perl for the moment. Better the Devil you know
Mike
Re: Which Python API?
I am so surprised about how limited are they python apis, I need to find one for using ImageMagick in one Raspberry pi but I cant find any function
Has anyone any idea how to execute a barrel distortion in ImageMagick via a python script?
Has anyone any idea how to execute a barrel distortion in ImageMagick via a python script?
Code: Select all
img.Distort(DistortMethod.Barrel, new[] { -0.92578, 1.3845, -2.09958 });
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Which Python API?
One way, is to use a subprocess call from python to an imagemagick command line. See viewtopic.php?f=4&t=32920
I do not know if PythonMagick contains calls to all the distort methods. It may be behind. But you might ask the developers if that is included or if they can include it.
I do not know if PythonMagick contains calls to all the distort methods. It may be behind. But you might ask the developers if that is included or if they can include it.
Re: Which Python API?
True, but since I am doing several steps it will be a waste to create all those temp files :/fmw42 wrote: ↑2018-01-25T12:34:13-07:00 One way, is to use a subprocess call from python to an imagemagick command line. See viewtopic.php?f=4&t=32920
I do not know if PythonMagick contains calls to all the distort methods. It may be behind. But you might ask the developers if that is included or if they can include it.
https://stackoverflow.com/questions/484 ... correction
Nobody uses imagemagick with python? I am quite impressive how lackluster is the experience
Re: Which Python API?
Perhaps you would be willing to help improve the experience rather than just complaining about other peoples work?Nobody uses imagemagick with python? I am quite impressive how lackluster is the experience
Re: Which Python API?
I agree with you, but in this particular case I just needed it to work for a short task.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Which Python API?
Have you tried using Wand with Python. See https://media.readthedocs.org/pdf/wand/latest/wand.pdfNobody uses imagemagick with python? I am quite impressive how lackluster is the experience
Re: Which Python API?
I was going to test it but they only support IM6.x, and the repo seemed quite abandoned so I went first with PythonMagick. But I will test again, thanks!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Which Python API?
You could perhaps do it with Python and Opencv. See https://docs.opencv.org/3.0-beta/doc/py ... ation.html
Re: Which Python API?
Yeah, thanks but that wrapper is quite undocumented too. I think I will do what you suggested at first, using a subprocess. I just need to write a long argumentfmw42 wrote: ↑2018-01-25T17:25:11-07:00 You could perhaps do it with Python and Opencv. See https://docs.opencv.org/3.0-beta/doc/py ... ation.html