Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

i have question regarding the convert and linux command in generate. i need to convert images using imagemagick

i do:

convert -quiet -regard-warnings image.jpg -colorspace RGB +repage /tmp/tempfile.img

that works

now, when i do:

convert $tmpA1 -median 2 -clut $tmpA2

i get:

convert: missing an image filename `/tmp/cartoon_2_17950.mpc' @ error/convert.c/ConvertImageCommand/2970.

after 3 day of searching i found this:

convert \( $tmpA1 -median 2 \) -clut $tmpA2

and it works

what is the purpose of the ( and )??

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Parenthesis limit the scope of an action. In this case it applies the median filter to just this input image, and then does something with that. You can read more about this in the manual (scroll down to Image Stack) and here's the extract:

In school, your teacher probably permitted you to work on problems on a scrap of paper and then copy the results to your test paper. An image stack is similar. It permits you to work on an image or image sequence in isolation and subsequently introduce the results back into the command line. The image stack is delineated with parenthesis. Image operators only affect images in the current stack.

share|improve this answer
    
so convert $tmpA1 -median 2 | convert -clut $tmpA2 will be the equivalent? –  Gino Sullivan Jan 25 '12 at 16:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.