composition of original offset

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
nobodyreally

composition of original offset

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: composition of original offset

Post by fmw42 »

use -geometry with composite or +page with -layers

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

Re: composition of original offset

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: composition of original offset

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply