So, I have a photography project where I ultimately want to take a lot of images and blend them together in strips. For instance, if I have 3 images, one black, one green, and one yellow, and they are all 60 pixels wide, I want there to be 3 vertical bands (red, green, black), and have a ~5-10 pixel blend in between each. so, each strip will kinda blend/fade into the next one. I was able to successfully use Image Magick to make the strips by determining how many files are in the sequence, how wide they are, and how wide the total image is, etc. But, there is of course no overlap, and I want there to be an overlap/blend between each.
the final composite would look something like this:
the source files would be three solid images (black, green, yellow). Of course, for my final project, I will be using actual image files. I can pretty easily do this by hand in Photoshop, but the goal is to do this with several hundred images, all blended. Think of a day to night transition of a time-lapse, or something like that. Any help? I'm pretty new to Image Magick.
taking small slices from multiple images and blending them?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: taking small slices from multiple images and blending th
First, break the problem down into simpler problems, such as abutting two images with a transition between them.
Suppose we have two images 60x60 pixels. Scripts are Windows; adjust as required. We get pure green from the colour name "lime".
Suppose we want a 10 pixel overlap. Then the final image will be 60*2-10 = 110 pixels wide. We can place each image on a canvas of this size:
I choose grey for the canvas, just so I can see it. It won't show in the final image.
Create a mask: black on the left, white on the right, with a smooth fade in the middle 10 pixels:
Apply the mask to the greenRight image, making it transparent where the mask was black and opaque where the mask was white. Place the result over the redLeft image.
There is a problem: the central portion is too dark. This is because we have worked in sRGB space, but RGB is a better choice.
You can extend this technique to any number of slices. Obvious improvements are possible, such as applying the colorspace adjustment to the mask instead of the photos.
Suppose we have two images 60x60 pixels. Scripts are Windows; adjust as required. We get pure green from the colour name "lime".
Code: Select all
"%IMG%convert" -size 60x60 xc:red red.tiff
"%IMG%convert" -size 60x60 xc:lime green.tiff
Code: Select all
"%IMG%convert" ^
-size 110x60 canvas:grey ^
red.tiff ^
-composite ^
redLeft.tiff
"%IMG%convert" ^
-size 110x60 canvas:grey ^
green.tiff ^
-gravity East ^
-composite ^
greenRight.tiff
Create a mask: black on the left, white on the right, with a smooth fade in the middle 10 pixels:
Code: Select all
"%IMG%convert" ^
-size 50x60 xc:black ^
( -size 60x10 gradient: -rotate 90 ) ^
-size 50x60 xc:white ^
+append ^
mask.tiff
Code: Select all
"%IMG%convert" ^
redLeft.tiff ^
( greenRight.tiff mask.tiff -compose CopyOpacity -composite ) ^
-compose Over -composite ^
out.tiff
Code: Select all
"%IMG%convert" ^
( redLeft.tiff -colorspace RGB ) ^
( greenRight.tiff mask.tiff -compose CopyOpacity -composite -colorspace RGB ) ^
-compose Over -composite ^
-colorspace sRGB ^
out2.tiff
snibgo's IM pages: im.snibgo.com
Re: taking small slices from multiple images and blending th
I think you took me too literally, sorry. what I posted was merely an example, but I'll be using actual photographs. the same thing can be accomplished in photoshop with a layer mask with a gradient to blend the layers.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: taking small slices from multiple images and blending th
You can use these techniques for any images, including actual photographs.cowanrg wrote:I think you took me too literally, sorry. what I posted was merely an example, but I'll be using actual photographs. the same thing can be accomplished in photoshop with a layer mask with a gradient to blend the layers.
snibgo's IM pages: im.snibgo.com
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: taking small slices from multiple images and blending th
Also see...
IM Examples, Photo Handling, Overlapping photos
http://www.imagemagick.org/Usage/photos/#overlap
IM Examples, Photo Handling, Overlapping photos
http://www.imagemagick.org/Usage/photos/#overlap
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: taking small slices from multiple images and blending th
THAT'S exactly what I'm looking for, thanks! I'll give that a try.anthony wrote:Also see...
IM Examples, Photo Handling, Overlapping photos
http://www.imagemagick.org/Usage/photos/#overlap