Page 1 of 1

composition of original offset

Posted: 2008-06-21T03:25:24-07:00
by nobodyreally
I have cut up an image into 16x16 images, removed duplicates and modified the smaller images. I have retained the original offset values for these 16x16 images as they were found on the original image (did not apply +repage). I now grayed out the original image and want to overlay the modified smaller images onto the original image in their same offset value. So that i have patches of colored tiles over the gray scaled image. I can not seem to find a way to apply the original offset values of the tile to the tile when I try to composition the tile to the original.

Re: composition of original offset

Posted: 2008-06-21T08:19:02-07:00
by fmw42
use -geometry with composite or +page with -layers

see a recent post similar to this viewtopic.php?f=1&t=11505

Re: composition of original offset

Posted: 2008-06-21T09:13:10-07:00
by nobodyreally
Unless I am mistaken you are referring to combining images based on known values via the command line, where as I need to use the original offset values stored in the tile.

Re: composition of original offset

Posted: 2008-06-23T18:05:13-07:00
by anthony
there are TWO offsetting methods used in IM.

The first is -geometry, which is -gravity effected and used by "composite".

The other is virtual canvas offset (-page,-repage) which are NOT gravity effected and are used for animations, and image layering.

-flatten and the other -layer operators use this.

So if you want to overlay your tiles with virtual offsets, -flatten them together. You don't even need to create the 'canvas' as -flatten automatically uses the saved canvas size of the first image, and creates one using the current -background color.

So your solution is simply...

Code: Select all

convert {list_of_tiles} -background grey -flatten  result.png
Other layering methods....

-mosaic expands that initial canvas in height and width

-layers merge expands a 'minimal' canvas (ignoring the given initial virtual canvas size) in all directions, including negative offsets, and gives it a new virtual offset, for further layering processing.

The -layer composite, method however is designed for composing two animations sequences, will apply BOTH a gravity effected geometry, AND a virtual canvas page offset.

see IM examples, Layering Images
http://imagemagick.org/Usage/layers/#flatten
and compose two image sequences
http://imagemagick.org/Usage/anim_mods/#composite