Is the SSIM a good loss function for an autoencoder in Image Compression? Is it reasonable to use SSIM as a loss function for an autoencoder (e.g. here)?

In my opinion, SSIM alone is not a good loss function as it depends only on the mean and the variance. Thus, it does not produce stable gradients towards the original image. Alternatively, I can well imagine that the SSIM in combination with a pixel-wise comparison (e.g. RMSE ) produces good results.
Am I missing something?

According to your Wiki link,
$$\text{SSIM} = \frac{(2\mu_x\mu_y+c_1)(2\sigma_{xy}+c_2)}{(\mu_x^2+\mu_y^2+c_1)(\sigma_x^2+\sigma_y^2+c_2)}=cls,$$
is a function based on three comparisons between image (patches):
$$\begin{matrix}
l=\frac{(2\mu_x\mu_y+c_1)}{(\mu_x^2+\mu_y^2+c_1)} &
c=\frac{(2\sigma_{x}\sigma_{y}+c_2)}{(\sigma_x^2+\sigma_y^2+c_2)}&
s = \frac{(2\sigma_{xy}+c_2)}{(2\sigma_{x}\sigma_{y}+c_2)}
\end{matrix}$$
Notice that maximizing $l$ (luminance) requires making $\mu_x$ and $\mu_y$ similar, likewise for maximizing $c$ (contrast) regarding $\sigma_x$ and $\sigma_y$ .
$s$, the "structure" factor, on the other hand, has $\sigma_{xy}$, the covariance.
So, maximizing the covariance between $x$ and $y$ also works towards maximizing SSIM.
