1

I want to make changes to my image and want to implement some of the functions that are present in ImageMagick. How can I do the same in Python ? Is there a python binding available?

Here is the link of textcleaner in imagemagick. http://www.fmwconcepts.com/imagemagick/textcleaner/index.php

3
  • textcleaner is not an imagemagick function it is a bash script written by an Imagemagick user. You should be able to run it as is from Python. Commented Jun 1, 2017 at 14:27
  • @Bonzo Can you help me with the python script ? Any link I can refer to? Commented Jun 2, 2017 at 13:18
  • I am afraid I do not use Python or scripts so can not be of any help. Commented Jun 2, 2017 at 13:39

1 Answer 1

2

Textcleaner is my script.

To run any (ImageMagick) bash shell script from Python, you would have to use the subprocess module. An example of this is at How to call a shell script from python code?

Here is an example that you would type in a terminal window or put in a PHP exec() command or from a python subprocess module.

Input:

enter image description here

textcleaner -g -e stretch -f 25 -o 10 -s 1 twinkle.jpg result.jpg

enter image description here

Sign up to request clarification or add additional context in comments.

4 Comments

How do I install textcleaner on ubuntu? (16.04 LTS) I didn't see any installation instructions on your site.
Textcleaner is just a simple text file that calls Imagemagick. It is a Unix shell script. You just download it and call in in a bash shell window or via PHP exec(). You can also call it from Python via th subprocess module. Pointers for use and setup are on my home page at fmwconcepts.com/imagemagick/index.php
Any idea why the command description (without any arguments) is being written twice? i.sstatic.net/sAsnb.png
Yes, some versions of Linux repeat the description twice and some do not. If you look on my home page there are some suggested edits you can make to the script that might fix the issue for your version Linux. I do not know which one if any work universally on all flavors of Linux/MacOSX/Window unix/Cygwin, etc. See fmwconcepts.com/imagemagick/index.php at section 13) of the Pointers for use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.