def METHOD_NAME(self, width, height):
    # determine new height and width
    scale_height = self.__height / height
    scale_width = self.__width / width
    if self.__keep_aspect_ratio:
        if self.__resize_method == "lower_bound":
            # scale such that output size is lower bound
            if scale_width > scale_height:
                # fit width
                scale_height = scale_width
            else:
                # fit height
                scale_width = scale_height
        elif self.__resize_method == "upper_bound":
            # scale such that output size is upper bound
            if scale_width < scale_height:
                # fit width
                scale_height = scale_width
            else:
                # fit height
                scale_width = scale_height
        elif self.__resize_method == "minimal":
            # scale as least as possbile
            if abs(1 - scale_width) < abs(1 - scale_height):
                # fit width
                scale_height = scale_width
            else:
                # fit height
                scale_width = scale_height
        else:
            raise ValueError(
                f"resize_method {self.__resize_method} not implemented"
            )
    if self.__resize_method == "lower_bound":
        new_height = self.constrain_to_multiple_of(
            scale_height * height, min_val=self.__height
        )
        new_width = self.constrain_to_multiple_of(
            scale_width * width, min_val=self.__width
        )
    elif self.__resize_method == "upper_bound":
        new_height = self.constrain_to_multiple_of(
            scale_height * height, max_val=self.__height
        )
        new_width = self.constrain_to_multiple_of(
            scale_width * width, max_val=self.__width
        )
    elif self.__resize_method == "minimal":
        new_height = self.constrain_to_multiple_of(scale_height * height)
        new_width = self.constrain_to_multiple_of(scale_width * width)
    else:
        raise ValueError(f"resize_method {self.__resize_method} not implemented")
    return (new_width, new_height)