Speedup image transformations for special cases