optimize pixel_perfect