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.
(http://a1ex.magiclantern.fm/bleeding-edge/visual-diff.jpg)

The script used to compare the two images:

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:
(http://a1ex.magiclantern.fm/bleeding-edge/visual-diff-v2.jpg)

and tried it on a real-world changeset: 47e2aa1 (https://bitbucket.org/hudson/magic-lantern/commits/47e2aa1d983f4f3d6f68f22420db695f3b08c975)
(http://a1ex.magiclantern.fm/bleeding-edge/visual-diff-v2-z.jpg)

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