How to smooth this timelapse photo?

I have done the following with imagemagick

How can I make the transitions between the slices smooth?

and what software to use?

Thanks

Can you redo the same and have some overlap between the slices?

I think I could do some overlap with the +smush but it will not be smoothed. What I’d like is to fade from the slice left into the next slice

Thanks

You add some overlap, and then you add progressive opacity on the overlap on one side of the upper layer:

Here done with Gimp but if you already automated things with IM, you can probably also use it to add the progressive opacity.

hello, have a look there, it can help
https://dellsystem.me/posts/time-slicing

1 Like

I suppose you have started from about 25 photos of the same view, at different times of the day. The photos seem to be aligned geometrically, so the task is to align them colorimetrically. I suppose you have overlapping areas between the bands shown.

The clouds are a problem. You could paint them out.

Some bands are significantly lighter than the bands on both sides. I suggest a normalising process so that there is a smooth progression from one band to the next band, and the next, and so on. You might do this iteratively: adjust a band so its average lightness is the average of the neighbouring bands. Do this for all bands except the extreme left and right. Do it repeatedly until the solution stabilises.

This could be done by “relax fill”, aka Poisson pasting, perhaps using a 25x1 pixel image (ie one pixel per band, representing the average colour of each band). See Seamless photomontage.

On that page, see “Colour-correction for panoramas” which would give a “perfect” gradient so band boundaries would not be visible.

The type of processing also depends on the result you want. Personally, I think the bars add to the effect, though I would want to normalize the harsher transitions.

For example, the brighter centre to right section in the sky and on the buildings is distracting. Too different from the rest of the image, which is very dark.

One approach would be to normalize each image before the splicing so that each image is around the same brightness throughout. That would help control the wacky variation. Normalization would make each image flat individually but less varied horizontally in the composite. To fix that, reverse the normalization by increasing local contrast while controlling the edges of each column.

Another approach would be the generate an HDR image where you can change the exposure gradually from left to right.

Interpolating data between images might be yet another possibility so that we end up with more than however many images you captured. We can go as far as content-aware interpolation where objects and details are tracked and re-positioned. Quite possible now that AI is more readily available.

But now, we are getting ahead of ourselves. The point is that you have to know your expectations and dream a little.

I assume there are 26 bands, of equal width. (This is false.)

Using ImageMagick, I smooth the lightness of the average of the bottom 165 pixels of each band. This avoids bias from the clouds, light buildings, orange reflections, etc.

magick ^
  timelapse.jpeg ^
  -crop x165+0+840 +repage ^
  -crop 26x1@ +repage ^
  -scale "1x1^!" ^
  +append +repage ^
  -colorspace Gray ^
  -alpha off ^
  ( +clone ^
    -fx "if ( i == 0 || i==25, u, (p[-1,0]+p[1,0])/2 )" ^
    -fx "if ( i == 0 || i==25, u, (p[-1,0]+p[1,0])/2 )" ^
    -fx "if ( i == 0 || i==25, u, (p[-1,0]+p[1,0])/2 )" ^
    -fx "if ( i == 0 || i==25, u, (p[-1,0]+p[1,0])/2 )" ^
    -fx "if ( i == 0 || i==25, u, (p[-1,0]+p[1,0])/2 )" ^
    -fx "if ( i == 0 || i==25, u, (p[-1,0]+p[1,0])/2 )" ^
    -fx "if ( i == 0 || i==25, u, (p[-1,0]+p[1,0])/2 )" ^
    -fx "if ( i == 0 || i==25, u, (p[-1,0]+p[1,0])/2 )" ^
    -fx "if ( i == 0 || i==25, u, (p[-1,0]+p[1,0])/2 )" ^
    -fx "if ( i == 0 || i==25, u, (p[-1,0]+p[1,0])/2 )" ^
    -alpha off ^
  ) ^
  -compose DivideDst -composite ^
  -scale "1502x1005^!" ^
  timelapse.jpeg ^
  +swap ^
  -compose Multiply -composite ^
  m.jpg

The result, m.jpg, is:

1 Like

It looks to me like you might be trying to replicate Stephen Wilkes’ Day to Night technique. He uses way more shots to achieve them (like 2500) so the strips are narrower and have smaller time differences between them.

Edit: Here is a link to an Instagram post by Wilkes that mentions a little bit about how he produced one of his images: Stephen Wilkes on Instagram: "My Day to Night of the J Bar L Ranch, @jbarlmontana in Melville Montana. I created this photograph while on assignment for @natgeo , documenting 30x30, a worldwide initiative for governments to designate 30% of the world’s land & oceans as protected areas by 2030.   Near Yellowstone National Park, the ranch aims to raise cattle while also conserving habitat for pronghorn, moose, trumpeter swans, and sage grouse, to name a few. Many fences have been modified to allow wildlife to cross the ranch. Herds are bunched and moved frequently to mimic buffalo, whose tread shaped these grasslands. The bulls in this scene—assembled from 60 photos out of 2,509—graze before mountains known as the Crazies, as time passes from daybreak to sunset to starlit night.     I’m so looking forward to tomorrow night’s virtual conversation with my gallerists and dear friends Sid & Michelle Monroe of @monroegallery ! We will be discussing my Day to Night work as well as my time documenting the aftermath of Hurricane Sandy.  The conversation is in coordination with @monroegallery’s exhibition “This Fragile Earth”.   My Day to Night of the J Bar L Ranch and other works from the Day to Night series are in a special virtual exhibition at www.monroegallery.com.   See the link in my bio to register for the conversation! #montana #jbarlranch #30x30 #cattle #natgeo #exhibition #earth #daytonight"

1 Like

That is one huge wall of text! :sweat_smile:

1 Like

I’d try to use alpha mask to start from solid on the desired width to roll to transluscent on a transition width over the next slice.
The composite command seems to be able to do the trick to prepare the slices.
It’s a bit like what @Ofnuts is suggesting.

composite -compose Dst_In \( mask.png -alpha copy \) main.png -alpha Set PNG32:result.png

I just look at that. Wow! Obviously it can be done but right now it’s way above my understanding. (I’m an old guy messing around with bash).

Yes, “I know” about Stephen Wilkes. His technique is completely different.

My understanding is that he spend from 8 to 24 hours in his cherry picker with his assistant and take a photo each time he sees something interesting happening in his field of view.

Then in photoshop he brings the “mini-scene” by doing some masking and adding it to the final image. He did a few interviews that are on youtube.

1 Like

That’s great for the water. I’ve another (of some building) on without any water.

How would I smooth the whole height of the strip?

Thanks

How could I do that in Darktable or ART?

Thanks

Many variations are possible. For example, we normalise using data from the top 200 rows. Instead of doing a slight smoothing, we adjust all bands to be the same lightness. The result loses the left-to-right light-to-dark graduation, so we grab that from the first and last bands, and restore that graduation at the end.

magick ^
  timelapse.jpeg ^
  -write mpr:INP ^
  -crop x200+0+0 +repage ^
  -crop 26x1@ +repage ^
  -scale "1x1^!" ^
  +append +repage ^
  -colorspace Gray ^
  -alpha off ^
  ( +clone ^
    -scale "1x1^!" ^
    -scale "26x1^!" ^
    -alpha off ^
  ) ^
  -define compose:clamp=off ^
  -compose DivideDst -composite ^
  -evaluate Divide %%[fx:maxima] ^
  ( +clone ^
    -chop 24x0+1+0 +repage ^
    -fx "1/u" ^
    -evaluate Divide %%[fx:maxima] ^
    -resize "1502x1^!" ^
    -evaluate Divide %%[fx:minima] ^
    -scale "1502x1005^!" ^
    -write mpr:GRAD ^
    +delete ^
  ) ^
  -scale "1502x1005^!" ^
  mpr:INP ^
  +swap ^
  -compose Multiply -composite ^
  mpr:GRAD ^
  -compose Multiply -composite ^
  m5.jpg

The result, m5.jpg, is:

This normalises the average of the top 200 rows. If you want to normalise the entire height, remove the first -crop.

I have used the supplied jpeg as input. We should never do this. Jpegs are only 8 bit/channel, and they are lossily compressed, so the image processing we can do without making the result really horrible is limited.

1 Like

Wendy Liu said : “instead of placing the images side by side, we let them overlap and blend them into each other”
blending is done by using “gray” mask
The Python script provided on github works well.
If you want to try it with python3 and imagemagick7, you should update the script :

  • python 3 : Integer division is achieved by using //
  • python3 : ‘xrange’ is now ‘range’
  • if imagemagick 6 then use with “composite_channel” operator=‘copy_opacity’
  • else if imagemagick 7 then use operator=‘copy_alpha’

my first test have been done using timelapses found on the web (VLC was my friend to get still images)

I’m not an ImageMagick guy, but I tried Poisson Blending, with 27 patches, and it generates this result, which is not that bad I think:

Compared to the “no blending” approach:

And the “overlap blending” approach :

I’m pretty sure we can then combine the Poisson + overlap blending results to keep the correct colors while smoothing out the banding effect.

EDIT: Something that seems to work quite well : Rather than using the FFT to solve the Poisson problem in one shot (i.e. invert the Laplacian), I use several (here, 1000) gradient descent iterations, but starting from the patch-blended image.
At the end, I get a nice mix between the two approaches. Here’s my result:

I wonder if that could do a nice G’MIC filter :slight_smile:

1 Like

OK, forget about all I said. There is so much simpler than that, using gaussian blending:

Result:

Code (G’MIC):

foo :
  a z
  100%,100%,1,3,"
    z = lerp(0,d#0 - 1,x/(w - 1));
    res = vector(#s);
    sum_weights = 0;
    repeat (d#0,k,
      weight = gauss(k - z,3);
      res+=weight*I(#0,x,y,k);
      sum_weights+=weight;
    );
    res/sum_weights"
  k.
7 Likes

for a guy that had never used a script gmic, what is the starting point to use your nice code?

tres beau resultat obtenu!!