Hi there. I am a complete noob to this, thanks in advance for the help.
I am trying to take a given piece of a .tiff image and over write the same section of a different, identically sized image. If this can be done in 1 or two steps that would be great.
Thanks again!
Chris
Copy and paste .tiff parts
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Copy and paste .tiff parts
What do you mean by the same section?
If the image is the same size (without transparency) over writing the other image will just replicate the original image.
However try this
For more see IM Examples, Alpha Composition
http://www.imagemagick.org/Usage/compose/
If the image is the same size (without transparency) over writing the other image will just replicate the original image.
However try this
Code: Select all
convert overlay.tiff background.tiff result.tiff
http://www.imagemagick.org/Usage/compose/
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Copy and paste .tiff parts
Thanks for the reply. That's not quite what i'm looking to do. I'll try to be more clear.
If the total size of both images was 400X1000, I would like able to take a piece of it like 100X100 to 300X300 (a 200X200 square) of the first image and paste it in the same spot on the second image without altering the rest of the second image.
If the total size of both images was 400X1000, I would like able to take a piece of it like 100X100 to 300X300 (a 200X200 square) of the first image and paste it in the same spot on the second image without altering the rest of the second image.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Copy and paste .tiff parts
Oh... Thatsi quite easy... crop and flatten, don't remove the offset from the cropped image!
the +swap in the above is to re-order the images so the second image is under the first. The -background is NOT needed if the images are fully opaque (no transparency).
An alturnative is....
This uses parentheses rather than swapping image order. without the parenthesis the crop would crop BOTH images. It then uses -composite to combine just those two images.
See IM Examples, "Basics" for image ordering and parenthesis, and "Mosaics" for Flattening a sequence of two or more images on top of each other. Also look and "Alpha Composition" for more of the composition operators.
Code: Select all
convert image1.tiff -crop 200x200+100+100 \
image2.tiff +swap -background none -flatten \
output.tiff
An alturnative is....
Code: Select all
convert image2.tiff \( image1.tiff -crop 200x200+100+100 \) \
-composite output.tiff
See IM Examples, "Basics" for image ordering and parenthesis, and "Mosaics" for Flattening a sequence of two or more images on top of each other. Also look and "Alpha Composition" for more of the composition operators.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Copy and paste .tiff parts
What would be the easiest way to determine the co-ordinates of the area that I wish to crop?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Copy and paste .tiff parts
Launch some image editor and write down the coordinates. I use a very old program called XV which pressing the middle button on the image pops up color and position information.
I am also planing some PerlTk type of programs to display images, and locate coordinates and do trial Magick runs to do manual panarama composite image registration (finding specific matching points in two images).
I am also planing some PerlTk type of programs to display images, and locate coordinates and do trial Magick runs to do manual panarama composite image registration (finding specific matching points in two images).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/