I've gone through mosaic.c and made a rewrite. I've removed all code from switchin() and instead the cpu intensive code is only called when needed. Unfortunatly this means that its impossible for the brush mode to work without extremly high cpu usage and ive therefore set mosaic to be a fullscreen mode only tool. Hopefully the cpu load when using fullscreen is small enough not to cause significant annoyance.