Optimized loop and new approach using image/draw