I'm using bash on Linux to do some stuff on my pictures and I've got a small issue with convert and the -sparse-color option.

When calling -sparse-color like this, it works like a charm :
Code: Select all
$ convert -size 900x900 xc: -sparse-color Shepards \
'150,150 rgb(0,255,255) 150,450 rgb(1,5,5) 150,750 rgb(252,1,251) 450,150 rgb(238,255,254)' \
sparse_color.jpg
Code: Select all
$ string="'150,150 rgb(0,255,255) 150,450 rgb(1,5,5) 150,750 rgb(252,1,251) 450,150 rgb(238,255,254)'"
$ echo ${string}
'150,150 rgb(0,255,255) 150,450 rgb(1,5,5) 150,750 rgb(252,1,251) 450,150 rgb(238,255,254)'
Code: Select all
$ convert -size 900x900 xc: -sparse-color Shepards \
"${string}" \
sparse_color.jpg
convert: invalid argument for option `sparse-color': Invalid number of Arguments @ error/mogrify.c/SparseColorOption/443.
Any help or advices would be really appreciated !
Thanks a lot.
