henrypijames wrote:The composition how-to
says:
In Alpha Composition only two images are ever involved, the 'source' and the 'destination' (or 'background'), though a third Masking Image may also be provided to limit the area of effect of the composition.
So I thought "-composite" can handle only two layers at a time - obviously that's not the case.
That is correct!!! composite and convert -compose only every merge two image at a time, EVER.
Flatten is a higher level operator designed to use multiple calls to composite to merge multiple images together, starting with a 'background' image of the current -background color, that is the same size as the 'virtual canvas' of the first image given.
However, the order in which "-composite" put the images in is very strage:
Code: Select all
convert old.png 1.png 2.png -composite new.png
The order is swapped as it makes the operator work better in a larger sense.
so it is background or destination image first, then the overlay or source image.
This way you can slowly build up a large image by overlaying new images being generated or read in, and modified before being overlaid.
The "composite" command, which only does ONE major task, does in in the order you would use when 'talking' about the compose operation.... source OVER destination.
Regardless of this problem, "-composite" still doesn't work here as it apparently repositions the cropped image back to +0+0 - inconsistent with what it does with the command in #1. Why is that?
Not ceratin what you mean, but I'll make a guess...
Their are two completely separate methods of handling offsets.
Compose uses Geometry with Gravity.
While Flatten / Mosaic / Merge is designed to handling 'layered images' which position images using 'virtual offsets' (no gravity) relative to a larger (usually) virtual, or imaginary canvas.
see
http://www.imagemagick.org/Usage/compose/#geometry
anthony wrote:To any computer 'cutting' is always a separate operation. Their is no such thing as 'moving' data, only 'copying' data, or 'modifying data' .
copy-paste is making a copy, and a modification.
cut-paste is really a copy-paste-cut.
First, it's not "always" like that. As I've noted, when you move a file - which can be done in cut-paste fashion in a graphical OS like Windows - to a directory on the same disk volume, the OS doesn't do copy-delete, but rewrite the directory entry without touching the file itself.
But that is not a cut/copy/paste operation at all. It is a link operation.
The file itself does not 'move' only the very small 'link' to the file in the directory structure.
Of course the index itself is copyed, and then deleted. In fact you can have as many linked to the same file from multiple places in a directory hierarchy. These are called 'hardlinks'.
So in fact it is still three operations, copy, paste and delete. But of the file, but of the LINK to teh file.
If you were to move a file from one disk drive (or different file system) to another, then the file itself really would have to be copied (lots more time), and the old one really deleted (can be quick, depending on the file system type).
A computer has no idea of 'move' as a single operation, only 'copy' and 'delete'.
However we are getting off topic.
Second, I know the with image manipulation, it's very unlikely that an arbitrary region can be directly "moved" in that way. But as I wrote before, I was hoping maybe IM has a "shortcut" that lets the user do easy cut-paste while it does the two-step internally.
[/quote]
Sorry no. It can copy the image into another 'layer' image, then delete the old one. But it is not 'built in as such.
However creating a better way of doing the 'delete' to a transparency, should be developed.
The problem here is that transparency is special, in that you can NOT 'draw' transparency in the usual way, you need to 'erase' it using a masking composition of some kind. This gets even harder
when semi-transparent edge pixels become involved, which is why I needed to insure the mask was correctly filled out into the complete 'cutting rectangle' in my example (more work
)