some fill with nearest pixels, but that may be hard to implement. alternatively, you can increase the size (e.g., by using nearest pixels to fill in blank areas. this is easy because it is shifting in axes-aligned directions), and then rotate.