append images to panorama repage doesnt extend canvas

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
pash
Posts: 8
Joined: 2011-04-26T07:59:16-07:00
Authentication code: 8675308

append images to panorama repage doesnt extend canvas

Post by pash »

Hi,

I want to create a panorama with multiple images with a slightly overlap.

So I created a windows batch file to add a shadow to the 4 images:

Code: Select all

convert -page +4+4  %FILENAME%.bmp -matte ( +clone -background black -shadow 40x1+1+1 ) +swap -background none -mosaic -unsharp 1.5x1+0.7+0.02  %FILENAME%.png
After that, I thought repage would extend the virtual canvas for every image by increasing %CENTER% by 100, so every image get shiftet 100px more to the right

Code: Select all

convert  %FILENAME%.png -gravity center -background None  -trim -repage +%CENTER%+0! OFF_%FILENAME%.png
but nothing happens, the resulting image OFF_%FILENAME%.png has the same dimensions as %FILENAME%.png
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: append images to panorama repage doesnt extend canvas

Post by anthony »

-repage is used to position images, or remove the position of the images relative to a virtual (make believe) canvas. The + form removes or resets that information. See IM Examples, Page, Repage, and the Virtual Canvas
http://www.imagemagick.org/Usage/basics/#page

-flatten will place images on a 'filled in' version of that virtual canvas (starting at 0 to the size found on the first image)

-mosiac will expand that canvas in positive directions if nessary, but images still needs to be given an appropriate offset.

-layers merge (the new kid on the block) starts with a 'minimal canvas based on the real part of the first image, and extend it as necessary to cover all the images in all directions positive and negative. any existing virtual canvas setting is ignored. You can then remove any negative offset.
http://www.imagemagick.org/Usage/layers/#merge

See... IM examples, Layering Examples
http://www.imagemagick.org/Usage/layers/#layer_examples

In all cases you need to specify the position of images.

Another example of 'overlapping images' in in Photo handling
http://www.imagemagick.org/Usage/photos/#overlap

Note in the last example how we add the transparency to one image only, and the use -repage to position the image on the virtual canavs.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
pash
Posts: 8
Joined: 2011-04-26T07:59:16-07:00
Authentication code: 8675308

Re: append images to panorama repage doesnt extend canvas

Post by pash »

Thank you Athony for pushing me in the right direction, finally i used

composite -compose Dst_Over -tile back2.jpg panorama_RIGHT.png panorama_RIGHT.jpg
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: append images to panorama repage doesnt extend canvas

Post by anthony »

Well that is one way of doing it, though it does not seem to be exactly what you seemed to be requesting.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply