This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Bilinear image rescaling. | |
General purpose, slightly optimized linear and bilinear rescaling functions. | |
Different from Photoshop. | |
Unlike Photoshop, scaling is reversible (as much as possible). | |
Like Photoshop, result is centered. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Barycentric image interpolation. | |
General purpose, not optimized, but src reading @lru_cache(maxsize=32) | |
compensate for this, reducing execution time ca. 30%. | |
@lru_cache(maxsize=None) gives ca. 40% time reduction but raise concerns | |
regarding cache growing on large images. |