It would be better to save the original transparency metadata inside create_image(), in a similar way it's done with the icc_profile. There's no guarantee that self.image is still the original one.