Re: compsite: using full canvas
Posted: 2011-01-06T23:35:36-07:00
only the layers operators expand the size of resulting image.
-flatten expands the first image to cover the virtual canvas setting of only that image.
typically however that is the same size as the actual image so generally no expansion occurs.
For example...
generates a 100x100 image
It will generate a 100x100 image regardless of where the actual image is located.
If the image is not on the 100x100 pixel canvas it is clipped.
-mosaic starts with the canvas setting of the first image, but then for each image (including the first again) uses the maximum of that starting size and and the right/bottom edges of the given images on the virtual canvas.
As such this is 100x100 plus the size of the first image as it is also offset by +100+100
-layers merge should ALL canvas information, and creates a new image with a virtual offset such that ALL images are visible at their virtual offsets. The canvas size of the first image is simply preserved without modification.
Another layers method -layersTrimBounds is closely similar to -layers merge, but does not compose images, but finds the maximum 'bounds' needed to whole all the images, then adjusts the offset so they are all minimally positive.
Note that the smallest offset +20+20 was subtracted from all the images, and the canvas size set to a size that would hold all the image. That is it reset the collective 'bounds' of all the given layer images without actually merging those images. It is especially useful for shrinking 'animations' that does not use all of the specified canvas, or trimmed images.
-flatten expands the first image to cover the virtual canvas setting of only that image.
typically however that is the same size as the actual image so generally no expansion occurs.
For example...
Code: Select all
convert -page 100x100+20+20 rose: -flatten show:
It will generate a 100x100 image regardless of where the actual image is located.
If the image is not on the 100x100 pixel canvas it is clipped.
Code: Select all
convert -page 100x100+70+70 rose: -flatten show:
As such this is 100x100 plus the size of the first image as it is also offset by +100+100
Code: Select all
convert -page 100x100+100+100 rose: -mosaic show:
Code: Select all
convert -page 1000x1000+20+20 rose: -page +70+70 rose: -layers merge show:
convert -page 1000x1000+20+20 rose: -page +70+70 rose: -layers merge info:
rose: ROSE 120x96 1000x1000+20+20 8-bit DirectClass 0.120u 0:00.120
Code: Select all
convert -page 1000x1000+20+20 rose: -page +70+70 rose: -layers TrimBounds info:
rose:[0] ROSE 70x46 120x96+0+0 8-bit DirectClass 9.67KB 0.000u 0:00.029
rose:[1] ROSE 70x46 120x96+50+50 8-bit DirectClass 9.67KB 0.000u 0:00.029