Generally speaking, the errors generated by the anti-aliased version are different than the errors from the binary transform, and I would expect it to potentially mess things up a bit for the exact algorithms. The key issue is that you need to evaluate more pixels than the closest one on the discrete grid to be certain of finding the nearest edge in the anti-aliased sense. I have not spent any deep thought on what that would mean for the two specific algorithms you mention.

Thanks for your comment, and your interest. I would be happy to discuss this further, but right now I have very little time to spend on actual coding and testing in this area. My focus when I did this was in getting it to work at all, because I needed the results for my research in computer graphics. The fine details about getting exact results (and even trying to figure out how "exact" would be interpreted in this context) were not my primary concern at the time.

]]>The *Jump Flooding Algorithm* (JFA) as used here for calculating the distance transform is fairly quick and produces good, but not exact, results. But there also exist algorithms that produce the *exact* Euclidean Distance Transform (EDT) in linear time, such as described in *A General Algorithm for Computing Distance Transforms in Linear Time* (A. Meijster, J.B.T.M. Roerdink, W.H. Hesselink, A general algorithm for computing distance transforms in linear time, Computational Imaging and Vision 18 (8) (2000) 331–340) and *A Linear Time Algorithm for Computing Exact Euclidean Distance Transforms of Binary Images in Arbitrary Dimensions* (C.R. Maurer, R. Qi, and V. Raghavan, IEEE Transactions on Pattern Analysis and Machine Intelligence, 25(2):265–270, February 2003). This is straightforward to parallelise on CPUs, and has been implemented on GPUs (in Cuda) as well as the *Parallel Banding Algorithm* (Thanh-Tung Cao, Ke Tang, Anis Mohamed, and Tiow-Seng Tan, Proceedings of the 2010 ACM SIGGRAPH symposium on Interactive 3D Graphics and Games (I3D '10)).

Would some of this be applicable here and possible to adapt to generate the anti-aliased distance transform? An exact algorithm would avoid the (small) errors still present in what Jump-Flooding calculates, and a linear-time algorithm might be able to calculate them a little bit more quickly as well; and a GPU implementation would seem to fit in well to be able to generate them from rendered content in real time within a game.

]]>