donkirkby/live-py-plugin

Difference amplification

donkirkby opened this issue · 0 comments

What I did

I tried the matplotlib fill tutorial when I hadn't looked at it in a while, and I couldn't remember what alpha value to use for the fill. I copied 0.3 from one of the examples.

plt.fill_between(X, Y+1, 1, facecolor='blue', alpha=0.30)

What happened

The difference was highlighted in red, but it wasn't clear whether my alpha was too high or too low.

Screenshot from 2023-02-20 08-44-17

What I wanted to happen

Steve Mould posted a video about motion amplification, and I wonder if we could use difference amplification. Instead of just highlighting the difference in red, move the differing pixels farther in the direction of their difference within RGB space. We might have to normalize the difference, so that even small differences are visible, if they're the only difference. If there are only a small number of pixels that differ, we might need to drag the surrounding pixels in the same direction.

My environment

Describe the versions of everything you were using:

  • Browser tutorial
  • Live Coding 4.9.0
  • Python 3.10.2