Convert test_image_tobitmap.py