I'm currently working on comparing a filtered image to its original (unfiltered) image using the SSIM (Structural similarity) index using Java.

My research brought me to a mathematical formula where the average, variance, covariance and the dynamic range of the two `BufferedImage`

s are needed.

Getting to calculate the average and the variance was not a big problem for me, however I can't figure out a way to get the number of bits per pixel needed to calculate the dynamic range, and the covariance value, is this something I can obtain from the `BufferedImage`

.

asked Feb 06 '23 06:02
#### Walkaa

`BufferedImage`

has a `getColorModel()`

method, and in the returned `ColorModel`

object there is a `getPixelSize()`

method which returns the number of bits per pixel described by that `ColorModel`

.

answered Mar 13 '23 00:03
#### Mike Nakis

### Recent Activity

- Apple Pay - authorize.net returns error 153 only when live, sandbox works
- How to continue cursor loop even error occured in the loop
- python find all neighbours of a given node in a list of lists
- Fatal error: Call to a member function setColumn() on a non-object in Magento
- Count how many of each value from a field with MySQL and PHP
- Python 32-bit development on 64-bit Windows [closed]

If you love us? You can donate to us via Paypal or buy me a coffee
so we can maintain and grow! **Thank you!**