It is possible to trap enemies like the Beetleworks and Robot Pirates. First, lure the enemy to a spot where you can thin things out. Thin it out, then quickly repaint it. If done correctly, the enemy will be trapped and be unable to move or attack. If you die, they will be free again.