Anti-aliasing

Circle inversion expands the size of output pixels. Close to the border they become much larger than input image pixels.

Sampling the color of only one input image pixel gives bad results due to aliasing (similar to texture mapping in video games.)

Solution:

I am using instead an average of input image pixels.
Area of averaging lies around mapped output image pixel using its mapped size. This is fast using summed area tables and easy to program in plain vanilla javascript.

Alternative: Mipmaps, using openGL and the processors of the graphics card.

More acurate, but too expensive: Averaging using a subdivision of the output pixel (subsampling). Depends on the size of the mapped pixel.

center  
left
right

Also improves image quality far away from the border!

Additional improvement: Smoothing the jaggies at the border of the disc!