How to smooth this timelapse photo?

Maybe the simplest way would be to use the filter Various / Custom Command from the G’MIC-Qt plug-in, and copy-paste the code of foo I’ve written in my previous post.

Like I show you in this video:

But I think I’ll try to make a new filter soon to allow better control (blending angle, etc.)

1 Like

I completely forgot about gaussian blending, which has been a favourite of mine. It is simple to implement, though it could result in blurrier and muddier images. I am sure you will make the filter slightly feature richer. :wink:

thank you very much

A filter specifically for blending multiple layers is on its way.
Should be ready tomorrow!

3 Likes

Super, very impressive
Can you clarify when we have to slice in multiple layers?
when the slicing should be or is done ?

  • during the construction of the multilayer
  • or by your code ?

For the time being, I can’t understand your code

When the frames are different, blending at overlaps creates a blurriness, losing detail. In the Wendy Liu example, the clouds and the water vary between frames, but the buildings are similar (they don’t move). @David_Tschumperle’s image almost entirely blurs the clouds. This may be desirable, of course.

Instead of blending, we can cut the images. This retains detail. When the cut line is vertical, the cuts are obvious.

The cut lines don’t need to be vertical, or even straight. We can make the cut lines jagged, like tearing a piece of paper, following a line from top to bottom that is the least difference between two images.

xMeander

The cut lines are obvious at top-right, where the sky has no clouds, and the plain blue sky is different between frames, so there is no good cut line. Elsewhere, the cut lines are not obvious (for example, zoom in above the tallest tower), and we have retained detail in the clouds and water.

Here comes the code. First, extract the frames. (These are probably different to David_Tschumperle’s frames.)

ffmpeg -ss 10s -to 44s -i "Stunning New York City skyline timelapse Day to night.mp4" -r 0.75 x-%06d.jpg

A Windows BAT script, nt2day.bat loops through the frames, combining frame 1 and 2, then the result with frame 3, then the result with frame 4, etc.

set OutFile=xMeander.png

%IMG7%magick x-000001.jpg %OutFile%

for /L %%N in (1,1,26) do (

  set LZ1=000000%%N
  set LZ1=!LZ1:~-6!

  set /A LZ2=%%N+1
  set LZ2=000000!LZ2!
  set LZ2=!LZ2:~-6!

  set /A StartCol=640*^(%%N-1^)/26

  echo !LZ1! !LZ2! !StartCol!

  rem call combFrame %OutFile% x-!LZ2!.jpg %OutFile% !StartCol! 25
  rem call combFrame %OutFile% x-!LZ2!.jpg %OutFile% 7 633
  call combFrame %OutFile% x-!LZ2!.jpg %OutFile% !StartCol! 200
)

combFrame.bat crops an area of full-height columns from both images, finds the absolute difference, and the darkest meandering path from top of bottom of that difference.

I tried out three variations of the stating column and width of the area to search for the best cut line.

rem %1 and %2 input images, same size
rem %3 output for combined image
rem %4 start column number for cut-line
rem %5 width of cut-line area

set InFile1=%1
set InFile2=%2
set OutFile=%3
set ColStart=%4
set ColWidth=%5

rem The mask will be black on left of cut-line, white on right.

%IM7DEV%magick ^
  ( %InFile1% ^
    +write mpr:In1 ^
    -set option:WW %%w ^
    -crop %ColWidth%x+%ColStart%+0 +repage ^
  ) ^
  ( %InFile2% ^
    +write mpr:In2 ^
    -crop %ColWidth%x+%ColStart%+0 +repage ^
  ) ^
  -compose Difference -composite ^
  -compose Over ^
  -process 'darkestmeander' ^
  ( +clone ^
    -scale "1x^!" ^
    -fill Black -colorize 100 ^
  ) ^
  +append +repage ^
  -fill White -draw "color %%[fx:w-1],0 floodfill" ^
  -crop %%[fx:w-1]x+0+0 +repage ^
  -alpha off ^
  -background Black -gravity East -extent %%[fx:w+%ColStart%]x ^
  -background White -gravity West -extent %%[fx:WW]x ^
  -write mpr:MASK ^
  +delete ^
  mpr:In1 mpr:In2 mpr:MASK ^
  -compose Over -composite ^
  %OutFile%

Process darkestmeander is an add-on to ImageMagick. It is documented at Dark paths. To use it, IM must be built with my Process modules.

1 Like

FYI, I’ve released a new filter in the G’MIC-Qt plug-in (v. 3.3.5_pre only for the moment).
Here is how it works with GIMP :

Not much time to investigate much, but I agree with @snibgo , this filter may oversmooth details that are too different between frames.
Back to work now :slight_smile:

6 Likes

That’s very cool and makes me think about a new photo project… :star_struck:

Thanks, David! :+1:

1 Like

genial!
I’ve been dreaming about it for so long

Apologies…it’s what Instagram did with my cut and paste, and I didn’t bother to change it. I say blame Zuck! :rofl:

one test with tide timelapse (sigma 30) night to day


this new filter is very fun

2 Likes

first result with a set of photo sleeping on my hard disk since december 2015
50 photos during one hour

use of “tone equalizer” after gimp and new Spatial Blend Multi-Layers filter
sigma = 20
10 mn of calculation on 36Mpixel images (raw converted in jpeg)
Spatial Blend Multi-Layers : robustness, nice ergonomy with sigma value and handles to choose the transition

3 Likes

Great to see this new filter is useful for you @olliwa ! That is exactely what motivates me to work on developping G’MIC, after all those years.
Cheers.

5 Likes

The construction (buildings etc) doesn’t look too bad. So I did a very crude selection of those in the GIMP, inverted the selection and then applied a 24px Gaussian blur:

Crude but effective?

may I ask an improvement or an explanation?
let’s have five layers

image

why the slices are not evenly distributed?
with sigma=0

is it by design?
Or for any reason I don’t suspect?

This should have been fixed already.
Have you tried pushing the “Update Filters” button ?

EDIT: Ah no. Looks like a bug. I’ll try to fix that ASAP.

Fixed with:

Filters have been updated on the G’MIC server, so pressing the “Update Filters” button will get you the fix, hopefully. Let me know if that works for you.

With 4 images, it now displays this:

2 Likes

thank you very much
it works well

1 Like

Sorry, I have not found the time and energy to explain or provide examples. In fact, I am so out of the loop that I no longer have any of the software installed on my current computer. Essentially, this strategy is to make the images the same throughout in brightness, the laziest way being simply to export them while they are in their least processed forms (and only normalizing/fixing areas that are extremely dark or bright). After you make the composite, do your normal raw processing on top. This laziest method is not much different from combining the input raw files into an HDR image, as I also suggested in my post; either method would yield a similar workflow.

If course, (Gaussian) blending is much easier to do, as demonstrated by David’s new filter. It is just that, as I and the other Alan have pointed out, it tends to blur out the details/objects and yields a different effect than that of your OP. That said, I am sure you could find ways to reintroduce detail/objects using various techniques in GIMP, etc.

I did some tests with the new gaussian blur filter.
If the goal is to obtain a gradual transition from one band to another, it works well.

smooth result by increasing the number of shots and the sigma value.

we can preserve some details in the sky or in the water, by using a small number of shots.

4 images

vs
40 images