Magic Lantern Forum

Developing Magic Lantern => General Development => Topic started by: a1ex on June 23, 2014, 10:14:24 AM

Title: Visual diff for nightly builds (proof of concept)
Post by: a1ex on June 23, 2014, 10:14:24 AM
With the recent developments regarding ML emulation in QEMU (http://www.magiclantern.fm/forum/index.php?topic=2864.msg117430#msg117430), it's possible to generate visual diffs of ML interface (automated). This could highlight changes in menu, overlays, or even run automated self-tests for ML in order to spot bugs.

Proof of concept: I've renamed some menu items just to check how it would look like.
(https://www.magiclantern.fm/forum/proxy.php?request=http%3A%2F%2Fa1ex.magiclantern.fm%2Fbleeding-edge%2Fvisual-diff.jpg&hash=fb46fb279e880ee89e7860fbd6c39948)

The script used to compare the two images:
Code: [Select]
compare a.png b.png -compose src -highlight-color yellow - | convert - -morphology Erode:2 Disk:5 -negate diff.jpg
composite a.png -compose Plus diff.jpg x.jpg
composite b.png -compose Plus diff.jpg y.jpg
montage x.jpg y.jpg -geometry 50%x50%+5+5 z.jpg

Interested in integrating this tool on the nightly builds page?

The biggest advantage IMO will be that you will no longer risk downloading untested builds; they will be self-tested. Of course, only on the feature subset that runs in the emulator, but still, much better than nothing.
Title: Re: Visual diff for nightly builds (proof of concept)
Post by: a1ex on July 16, 2014, 09:46:18 PM
Tweaked the algorithm a bit:
(https://www.magiclantern.fm/forum/proxy.php?request=http%3A%2F%2Fa1ex.magiclantern.fm%2Fbleeding-edge%2Fvisual-diff-v2.jpg&hash=9446ba11e169c648c9b95c63f87f1e04)

and tried it on a real-world changeset: 47e2aa1 (https://bitbucket.org/hudson/magic-lantern/commits/47e2aa1d983f4f3d6f68f22420db695f3b08c975)
(https://www.magiclantern.fm/forum/proxy.php?request=http%3A%2F%2Fa1ex.magiclantern.fm%2Fbleeding-edge%2Fvisual-diff-v2-z.jpg&hash=8b1f9e705785116b4fcc65a7b010fbd6)

How many of you noticed this recent addition from dmilligan in the change log? With this trick, it would be obvious what's new.