Shake filter RNG

I had two images in a project, both on-screen for the exact same frames, and applied the shake filter to both of them. It seems that the shake filter uses a fixed RNG seed, as the images moved in sync, for my use case this is not what I wanted.

Some people might want that behavior, so I’d suggest making the shake filter’s RNG seed customizable, this gives the user the option to make shaking synchronized or not. This also has the added benefit of letting users try a couple of RNG seeds and picking the one they like the most.

That effect comes from this project if you want to make a direct request:

I checked the source code and they are using a deterministic function, so it wouldn’t be the quick fix I was expecting.

It’s easy to slightly change a few of the settings to make the shaking look totally different on each image… Not sure adding a random button would make things easier. You might need to hit it many times to get 2 shake patterns that look good together.

You’re right, and slight tweaks will be the fix that I’ll use. There are some conditions that my project has that make this a bit more difficult than your video show. The effect I was going for is “random slight offset every frame”, with two images that intertwine on most of the screen, and I want the effect to be uniform for the two images. In your video it’s noticeable that the two images behave differently (cat shakes a lot faster).

The offset the filter uses is:
double shake_x = sin(time * speed_factor) * cos(time * speed_factor * 0.73) * max_amp_x;
double shake_y = sin(time * speed_factor * 0.89) * cos(time * speed_factor * 1.1) * max_amp_y;
most of the difference in your video comes from the different speeds (almost x2), the functions are deterministic, but look random, so in your case they drift apart really fast. For my use case, that means that I have to balance the speed ratio, to minimize the time where they look in sync but also minimize the visible change in shake speed.

I got this to a version that looks good, but it’s a really finicky and unintuitive way to achieve something that should be a feature.

Also, I wasn’t suggesting to add a “random” button, my idea was to add a field in which you type the seed number for the random number generator. This would make it easy to get the same shake for two images, just input the same number. With the function being deterministic we cannot do that, but we could achieve the same behavior by offsetting the time in the deterministic function by the seed, this would preserve the shape of the function and default behavior while adding the option to randomize the shake, if I have time later I’ll open a PR with this into that repo.