outside of loop and remove a function call. Should give a little speedup when painting inside the image editor.