diff --git a/mypy.ini b/mypy.ini
index 5a12ab1..f9864c6 100644
--- a/mypy.ini
+++ b/mypy.ini
@@ -1,3 +1,4 @@
 [mypy]
 ignore_missing_imports = True
 strict = true
+plugins = numpy.typing.mypy_plugin
diff --git a/win2xcur/utils.py b/win2xcur/utils.py
index 3ff8729..5cb62af 100644
--- a/win2xcur/utils.py
+++ b/win2xcur/utils.py
@@ -1,12 +1,12 @@
-from typing import cast
+from typing import Any
 
-import numpy
+import numpy as np
 
 
 def premultiply_alpha(source: bytes) -> bytes:
-    buffer = numpy.frombuffer(source, dtype=numpy.uint8).astype(numpy.double)
+    buffer: np.ndarray[Any, np.dtype[np.double]] = np.frombuffer(source, dtype=np.uint8).astype(np.double)
     alpha = buffer[3::4] / 255.0
     buffer[0::4] *= alpha
     buffer[1::4] *= alpha
     buffer[2::4] *= alpha
-    return cast(bytes, buffer.astype(numpy.uint8).tobytes())
+    return buffer.astype(np.uint8).tobytes()