def _center_tile(self, position, size):
        x, y = position
        w, h = size
        """Calculate the centre of a tile given the top-left corner and the size of the image."""
        return x + (self.cell_width - w) / 2, y + (self.cell_height - h) / 2
Calculate the centre of a tile given the top-left corner and the size of the image.