magick -convolve 1,1,1,1,1,1,1,1,1 works well but fails if I say 1,1,1, 1,1,1, 1,1,1. This would help me to arrange my array when it is bigger e.g. 7x7.
Any workaround?
Why are spaces forbidden in the -convolve argument
-
- Posts: 41
- Joined: 2016-10-04T02:08:22-07:00
- Authentication code: 1151
- Location: Nice, France
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Why are spaces forbidden in the -convolve argument
Put quotes about your arguments and see if that works. With spaces, the arguments are considered as multiple sets of arguments and not one set.
Also consider using the newer -morphology convolve rather than the older legacy -convolve. See http://www.imagemagick.org/Usage/convolve/
Also consider using the newer -morphology convolve rather than the older legacy -convolve. See http://www.imagemagick.org/Usage/convolve/
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Why are spaces forbidden in the -convolve argument
The shell (bash, or Windows CMD, or whatever) breaks the command line at spaces into arguments, passing each of those separately to the executable binary. But it treats a quoted string as a single arguments, even if it contains spaces.
For Windows, use double-quote: ".
For bash, use single-quote ' or double-quote ", according to your needs.
For Windows, use double-quote: ".
For bash, use single-quote ' or double-quote ", according to your needs.
snibgo's IM pages: im.snibgo.com
-
- Posts: 41
- Joined: 2016-10-04T02:08:22-07:00
- Authentication code: 1151
- Location: Nice, France
Re: Why are spaces forbidden in the -convolve argument
With Windows I obtain what I want with
magick chunk.png -convolve ^
0,0,3,4,3,0,0,^
3,4,4,4,4,4,3,^ etc.
magick chunk.png -convolve ^
0,0,3,4,3,0,0,^
3,4,4,4,4,4,3,^ etc.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Why are spaces forbidden in the -convolve argument
You have no spaces so it works fine. The issue was when the argument to -convolve has spaces, which require quoting.Jean-Pierre Coulon wrote: ↑2018-06-22T00:22:01-07:00 With Windows I obtain what I want with
magick chunk.png -convolve ^
0,0,3,4,3,0,0,^
3,4,4,4,4,4,3,^ etc.