resize(I,w,h)
resize_to(I1,I2)

\(\text{resize}(w_{\text{in}},h_{\text{in}},w_{\text{out}},h_{\text{out}}) = w_{\text{out}},h_{\text{out}}\)

resize_max(I,w,h)

\(\begin{align} &w_f = \min\left(\dfrac{w_\text{max}}{w_\text{in}},1\right)\\ &h_f = \min\left(\dfrac{h_\text{max}}{h_\text{in}},1\right)\\ &f = \min(w_f,h_f)\\ &\text{resize_max}(w_{\text{in}},h_{\text{in}},w_{\text{max}},h_{\text{max}}) = \text{resize_factor}(w_{\text{in}},h_{\text{in}},f) \end{align}\)