Quick answer: Pygame tilemap rendering slow after switching to scaled tiles? pygame.transform.scale runs per-blit; pre-scale once at load time.

Original 16x16 tiles; player wants 32x32. Per-frame scale costs 8ms; pre-scaled costs 0.5ms.

Pre-scale at load

Load tiles; scale once via pygame.transform.scale_by; cache the result. Per-frame blit is fast.

Or use SDL2 GPU scale

Through pygame's GPU surface; let the GPU scale. Free for the CPU.

Avoid mid-frame transform

Any transform per-frame is a candidate for caching.

“Per-frame transforms are CPU work. Caching is the universal cure.”

Audit your render loop for transform calls. Each is a candidate for pre-computation.

Related reading