← Back to context

Comment by xpe

8 days ago

You could order the presentation of a set of images by some distance metric :)

- naively: Levenshtein

- better: real world edit time based on a model of the display : probably dominated by XY travel distance

I was wondering about the algorithm to drive the plotter and update pixels, which ties into this.

Given the current image being shown and the next image, you (presumably) want to plot the pixels of the next image as quickly as possible. I believe the optimal algorithm is:

1. Calculate the set of pixels that are changed between the current and next image.

2. Find the shortest path from the plotter's current position through each of those pixels. I believe breadth-first search (O(n)) is sufficient here.

Running this on all potential upcoming images and choosing the one with the lowest total path cost would do what you propose under "better".