@staticmethod
def compute_bounds(data, pixel_size, center_on):
    """Return image bounds from *pixel_size* (scalar or tuple)"""
    if not isinstance(pixel_size, (tuple, list)):
        pixel_size = [pixel_size, pixel_size]
    dx, dy = pixel_size
    xmin, ymin = 0.0, 0.0
    xmax, ymax = data.shape[1] * dx, data.shape[0] * dy
    if center_on is not None:
        xc, yc = center_on
        dx, dy = 0.5 * (xmax - xmin) - xc, 0.5 * (ymax - ymin) - yc
        xmin -= dx
        xmax -= dx
        ymin -= dy
        ymax -= dy
    return xmin, xmax, ymin, ymax
