Page 1 of 1

append image from stdin to itself

Posted: 2011-10-27T13:14:36-07:00
by errx
I am receiving image data from stdin and I want to append it to itself without creating temporary files. Is it possible?
Here is the solution with temporary files:
1. save stdin to tmp.file
2. convert tmp.file tmp.file +append result.img

Re: append image from stdin to itself

Posted: 2011-10-27T15:26:30-07:00
by errx
I guess i found the solution:
convert - -clone 0 +append out.gif

Re: append image from stdin to itself

Posted: 2011-10-27T19:28:34-07:00
by anthony
The -clone should be in parenthesis. The operator is basically designed with parthesis use in mind! If parenthesis is not used you could get different behaviour if you move that 'duplicatation' into parenthesis.

For example...
convert left_image.png \( - -clone 0 \) right_image.png +append line_of_images.png
will produce a different result even though the operations ' - -clone 0 ' have not changed, just put into a "side process"

In IMv7 using -clone outside of parenthesis will likely produce a warning message.

To clone without parenthesis (in newer versions of IM) you use -duplicate
This operator clones images from the same image sequence.
It still generates fast clones of images, but has the added feature of allowing you to make multiple copies of those images.
More importantly it does not require parenthesis for its correctly defined usage.

IM Examples, Basics, Duplicate
http://www.imagemagick.org/Usage/basics/#duplicate