I haven’t verified your code, but this general approach should work.
This example 26 shows how to use a rotation matrix and might be useful in case you want to extend your use case.



 enterthevoidf22:

generally, i’m sure this issue will repeat itself and should be addressed


I’m not sure which issue you are referring to, but if you think it’s an issue that single pixels might be “blurred” in the rotated image, i.e. they would spread to more than a single pixel location, I think this is rather a known image processing “issue”.