donkirkby / live-py-plugin

Live coding in Python with PyCharm, Emacs, Sublime Text, or even a browser
https://donkirkby.github.io/live-py-plugin
MIT License
292 stars 56 forks source link

Difference amplification #520

Closed donkirkby closed 1 year ago

donkirkby commented 1 year ago

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: