Improve the performance of PngWriter._build_image_data_bd4_nt2()