Skip to content

Commit 2a61c26

Browse files
committed
2.6.1: add MSE and MSEF metrics
1 parent a41a0ce commit 2a61c26

12 files changed

+207
-70
lines changed

CHANGELOG

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
JPEG Recompress
22
https://github.com/ImageProcessing-ElectronicPublications/jpeg-recompress
33

4+
2.6.1 "msef"
5+
6+
Added MSE and MSEF metric.
7+
Research: correct trends UM (44 images)
8+
49
2.6.0 "sum"
510

611
Added VIFP 1 layer in SUM metric.

README.md

+13-10
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ Name | Option | Description
5454
----------- | ------------- | -----------
5555
MPE | `-m mpe` | Mean pixel error (as used by [imgmin](https://github.com/rflynn/imgmin))
5656
PSNR | `-m psnr` | [Peak signal-to-noise ratio](https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio)
57+
MSE | `-m mse` | [Mean squared error](https://en.wikipedia.org/wiki/Mean_squared_error)
58+
MSEF | `-m msef` | `sqrt(MSE/Variance)`
59+
Correlation | `-m cor` | [Correlation](https://en.wikipedia.org/wiki/Correlation)
5760
SSIM | `-m ssim` | [Structural similarity](http://en.wikipedia.org/wiki/Structural_similarity)
5861
MS-SSIM* | `-m ms-ssim` | Multi-scale structural similarity (slow!) ([2008 paper](http://foulard.ece.cornell.edu/publications/dmr_hvei2008_paper.pdf))
5962
VIFP1 | `-m vifp1` | [The visual information fidelity (VIF)](http://live.ece.utexas.edu/publications.php) 1 layer.
6063
SmallFry | `-m smallfry` | Linear-weighted BBCQ-like ([original project](https://github.com/dwbuiten/smallfry), [2011 BBCQ paper](http://spie.org/Publications/Proceedings/Paper/10.1117/12.872231) -> [LibSmallFry](https://github.com/ImageProcessing-ElectronicPublications/libsmallfry))
6164
SharpenBad | `-m shbad` | Sharpen discrepancies ([LibSmallFry](https://github.com/ImageProcessing-ElectronicPublications/libsmallfry))
62-
Correlation | `-m cor` | [Correlation](https://en.wikipedia.org/wiki/Correlation)
6365
NHW | `-m nhw` | NHW convolutional metric ([original project](https://github.com/rcanut/NHW_Neatness_Metrics) -> [LibSmallFry](https://github.com/ImageProcessing-ElectronicPublications/libsmallfry))
6466
1 pair | `-m ssimfry` | `(ssim + smallfry) / 2`
6567
2 pair | `-m ssimshb` | `(ssim + shbad) / 2`
@@ -73,15 +75,16 @@ SUMMARY | `-m sum` | `(ssim + vipf1 + smallfry + shbad + nhw) / 5` **DE
7375
```
7476
Trends:
7577
```
76-
UM = 2.99 * sqrt(sqrt(1.0 / MPE)) - 1.70
77-
UM = 1.00 * sqrt(PNSR) - 5.32
78-
UM = 2.07 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.26
78+
UM = 2.42 * sqrt(sqrt(1.0 / MPE)) - 1.38
79+
UM = 0.87 * sqrt(PNSR) - 4.70
80+
UM = 1.02 * sqrt(sqrt(1.0 / MSEF)) - 1.49
81+
UM = 2.87 * cor_sigma(cor_sigma(COR)) - 1.42
82+
UM = 1.73 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.11
7983
UM = 1.59 * cor_sigma(cor_sigma(MS_SSIM)) + 0.01
80-
UM = 3.69 * cor_sigma(VIFP1) - 2.74
81-
UM = 0.0684 * SMALLFRY - 6.29
82-
UM = 1.17 * SHARPENBAD - 0.12
83-
UM = 3.03 * cor_sigma(cor_sigma(COR)) - 1.52
84-
UM = 0.40 * sqrt(sqrt(1.0 / NHW)) - 0.48
84+
UM = 1.12 * cor_sigma(cor_sigma(VIFP1)) - 0.03
85+
UM = 0.0658 * SMALLFRY - 6.07
86+
UM = 1.00 * SHARPENBAD + 0.05
87+
UM = 0.36 * sqrt(sqrt(1.0 / NHW)) - 0.41
8588
8689
cor_sigma(M) = 1.0 - sqrt(1.0 - M * M)
8790
```
@@ -92,7 +95,7 @@ The JPEG format allows for subsampling of the color channels to save space. For
9295

9396
#### Example Commands
9497

95-
```bash
98+
```shell
9699
# Default settings
97100
jpeg-recompress image.jpg compressed.jpg
98101

man/man1/jpeg-compare.1

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "jpeg-compare" 1 2.6.0 "31 Jan 2023" "User manual"
1+
.TH "jpeg-compare" 1 2.6.1 "02 Feb 2023" "User manual"
22

33
.SH NAME
44
jpeg-compare
@@ -17,7 +17,7 @@ jpeg-compare [options] image1.jpg image2.jpg
1717
output program help
1818
.TP
1919
\fB\-m\fR, \fB\-\-method\fR [arg]
20-
set comparison method to one of 'fast', 'mpe', 'psnr', 'ssim', 'ms-ssim', 'vifp1', 'smallfry', 'shbad', 'cor', 'nhw', 'ssimfry', 'ssimshb', 'sum' [fast]
20+
set comparison method to one of 'fast', 'mpe', 'psnr', 'mse', 'msef', 'cor', 'ssim', 'ms-ssim', 'vifp1', 'smallfry', 'shbad', 'nhw', 'ssimfry', 'ssimshb', 'sum' [fast]
2121
.TP
2222
\fB\-n\fR, \fB\-\-norm\fR
2323
UM scale metric
@@ -74,15 +74,16 @@ jpeg-compare --method ssim image1.jpg image2.jpg
7474
.PP
7575
Trends:
7676

77-
UM = 2.99 * sqrt(sqrt(1.0 / MPE)) - 1.70
78-
UM = 1.00 * sqrt(PNSR) - 5.32
79-
UM = 2.07 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.26
77+
UM = 2.42 * sqrt(sqrt(1.0 / MPE)) - 1.38
78+
UM = 0.87 * sqrt(PNSR) - 4.70
79+
UM = 1.02 * sqrt(sqrt(1.0 / MSEF)) - 1.49
80+
UM = 2.87 * cor_sigma(cor_sigma(COR)) - 1.42
81+
UM = 1.73 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.11
8082
UM = 1.59 * cor_sigma(cor_sigma(MS_SSIM)) + 0.01
81-
UM = 3.69 * cor_sigma(VIFP1) - 2.74
82-
UM = 0.0684 * SMALLFRY - 6.29
83-
UM = 1.17 * SHARPENBAD - 0.12
84-
UM = 3.03 * cor_sigma(cor_sigma(COR)) - 1.52
85-
UM = 0.40 * sqrt(sqrt(1.0 / NHW)) - 0.48
83+
UM = 1.12 * cor_sigma(cor_sigma(VIFP1)) - 0.03
84+
UM = 0.0658 * SMALLFRY - 6.07
85+
UM = 1.00 * SHARPENBAD + 0.05
86+
UM = 0.36 * sqrt(sqrt(1.0 / NHW)) - 0.41
8687
cor_sigma(M) = 1.0 - sqrt(1.0 - M * M)
8788

8889
.SH COPYRIGHT

man/man1/jpeg-hash.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "jpeg-hash" 1 2.6.0 "31 Jan 2023" "User manual"
1+
.TH "jpeg-hash" 1 2.6.1 "02 Feb 2023" "User manual"
22

33
.SH NAME
44
jpeg-hash

man/man1/jpeg-recompress.1

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "jpeg-recompress" 1 2.6.0 "31 Jan 2023" "User manual"
1+
.TH "jpeg-recompress" 1 2.6.1 "02 Feb 2023" "User manual"
22

33
.SH NAME
44
jpeg-recompress
@@ -35,7 +35,7 @@ output program help
3535
set the number of runs to attempt [6]
3636
.TP
3737
\fB\-m\fR, \fB\-\-method\fR [arg]
38-
set comparison method to one of 'mpe', 'psnr', 'ssim', 'ms-ssim', 'vifp1', 'smallfry', 'shbad', 'cor', 'nhw', 'ssimfry', 'ssimshb', 'sum' [sum]
38+
set comparison method to one of 'mpe', 'psnr', 'mse', 'msef', 'cor', 'ssim', 'ms-ssim', 'vifp1', 'smallfry', 'shbad', 'nhw', 'ssimfry', 'ssimshb', 'sum' [sum]
3939
.TP
4040
\fB\-n\fR, \fB\-\-min\fR [arg]
4141
minimum JPEG quality [40]
@@ -145,15 +145,16 @@ jpeg-recompress --quiet image.jpg compressed.jpg
145145
.PP
146146
Trends:
147147

148-
UM = 2.99 * sqrt(sqrt(1.0 / MPE)) - 1.70
149-
UM = 1.00 * sqrt(PNSR) - 5.32
150-
UM = 2.07 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.26
148+
UM = 2.42 * sqrt(sqrt(1.0 / MPE)) - 1.38
149+
UM = 0.87 * sqrt(PNSR) - 4.70
150+
UM = 1.02 * sqrt(sqrt(1.0 / MSEF)) - 1.49
151+
UM = 2.87 * cor_sigma(cor_sigma(COR)) - 1.42
152+
UM = 1.73 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.11
151153
UM = 1.59 * cor_sigma(cor_sigma(MS_SSIM)) + 0.01
152-
UM = 3.69 * cor_sigma(VIFP1) - 2.74
153-
UM = 0.0684 * SMALLFRY - 6.29
154-
UM = 1.17 * SHARPENBAD - 0.12
155-
UM = 3.03 * cor_sigma(cor_sigma(COR)) - 1.52
156-
UM = 0.40 * sqrt(sqrt(1.0 / NHW)) - 0.48
154+
UM = 1.12 * cor_sigma(cor_sigma(VIFP1)) - 0.03
155+
UM = 0.0658 * SMALLFRY - 6.07
156+
UM = 1.00 * SHARPENBAD + 0.05
157+
UM = 0.36 * sqrt(sqrt(1.0 / NHW)) - 0.41
157158
cor_sigma(M) = 1.0 - sqrt(1.0 - M * M)
158159

159160
.SH COPYRIGHT

man/man1/jpeg-zfpoint.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "jpeg-zfpoint" 1 2.6.0 "31 Jan 2023" "User manual"
1+
.TH "jpeg-zfpoint" 1 2.6.1 "02 Feb 2023" "User manual"
22

33
.SH NAME
44
jpeg-zfpoint

man/man1/webp-compress.1

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "webp-compress" 1 2.6.0 "31 Jan 2023" "User manual"
1+
.TH "webp-compress" 1 2.6.1 "02 Feb 2023" "User manual"
22

33
.SH NAME
44
webp-compress
@@ -31,7 +31,7 @@ output program help
3131
set the number of runs to attempt [8]
3232
.TP
3333
\fB\-m\fR, \fB\-\-method\fR [arg]
34-
set comparison method to one of 'mpe', 'psnr', 'ssim', 'ms-ssim', 'vifp1', 'smallfry', 'shbad', 'cor', 'nhw', 'ssimfry', 'ssimshb', 'sum' [sum]
34+
set comparison method to one of 'mpe', 'psnr', 'mse', 'msef', 'cor', 'ssim', 'ms-ssim', 'vifp1', 'smallfry', 'shbad', 'nhw', 'ssimfry', 'ssimshb', 'sum' [sum]
3535
.TP
3636
\fB\-n\fR, \fB\-\-min\fR [arg]
3737
minimum quality [1]
@@ -109,15 +109,16 @@ webp-compress --quiet image.jpg compressed.webp
109109
.PP
110110
Trends:
111111

112-
UM = 2.99 * sqrt(sqrt(1.0 / MPE)) - 1.70
113-
UM = 1.00 * sqrt(PNSR) - 5.32
114-
UM = 2.07 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.26
112+
UM = 2.42 * sqrt(sqrt(1.0 / MPE)) - 1.38
113+
UM = 0.87 * sqrt(PNSR) - 4.70
114+
UM = 1.02 * sqrt(sqrt(1.0 / MSEF)) - 1.49
115+
UM = 2.87 * cor_sigma(cor_sigma(COR)) - 1.42
116+
UM = 1.73 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.11
115117
UM = 1.59 * cor_sigma(cor_sigma(MS_SSIM)) + 0.01
116-
UM = 3.69 * cor_sigma(VIFP1) - 2.74
117-
UM = 0.0684 * SMALLFRY - 6.29
118-
UM = 1.17 * SHARPENBAD - 0.12
119-
UM = 3.03 * cor_sigma(cor_sigma(COR)) - 1.52
120-
UM = 0.40 * sqrt(sqrt(1.0 / NHW)) - 0.48
118+
UM = 1.12 * cor_sigma(cor_sigma(VIFP1)) - 0.03
119+
UM = 0.0658 * SMALLFRY - 6.07
120+
UM = 1.00 * SHARPENBAD + 0.05
121+
UM = 0.36 * sqrt(sqrt(1.0 / NHW)) - 0.41
121122
cor_sigma(M) = 1.0 - sqrt(1.0 - M * M)
122123

123124
.SH COPYRIGHT

0 commit comments

Comments
 (0)