As a kind of commutative and associative four‐dimensional algebra, commutative quaternion has better applications in color image and signal processing than quaternion. Matrix decomposition is of great concern in the theoretical study and numerical calculation of commutative quaternion. Two kinds of disadvantages of commutative quaternion make the decomposition of commutative quaternion matrix extremely difficult. On one hand, commutative quaternion is not a kind of complete four dimensional division algebra because of the zero divisors. On the other hand, computing the inverse of commutative quaternion is very complicated. In this paper, the semi‐tensor product (STP) of matrices will be used to overcome the above two kinds of shortcomings. And we will propose a real structure‐preserving algorithm based on STP of matrices for commutative quaternion LU decomposition, which makes full use of high‐level operations, relation of operations between commutative quaternion matrices and their ‐representation matrices. Numerical experiments will be provided to demonstrate the efficiency of the real structure‐preserving algorithm based on STP of matrices. Meanwhile, we will apply the structure‐preserving algorithm for strict image authentication.