[ create a new paste ] login | about

Link: http://codepad.org/P8v889KY    [ raw code | fork ]

Python, pasted on Jan 19:
1
2
3
4
5
6
7
If I have an image sized (x1, y1), and I want to resize it to (x2, y2) I can do it in the following way:

* For each line in the original image, repeat each pixel x2 times.
* Repeat the resulting line y2 times, giving an image with dimensions (x1*x2, y1*y2)
* For each Block of (x1, y1) pixels in the resulting image, take the sum of the pixels and divide by x1*y1 ie average it.

Does this algorithm have a name? Is it mathematically equivalent to one of the standard resizing methods?


Create a new paste based on this one


Comments: