Trim that distracting background off!
MATL, 5 bytes
JYaZy

Try it online! Or verify all test cases.
Explanation
JYa   % Implicit input. Unpad matrix. This removes outer zeros
Zy    % Size. Implicit display