Commit a32210d
committed
feat: Use the available file-size for avatar-images better
The resolution-limits for avatar-images are currently 512x512 or 128x128.
Reducing the resolution further, to 2/3 each step, can reduce the quality
much more than is necessary to fit within the file-size-limits,
which are currently 60 kB or 20 kB.
An image made entirely of noise (which results in unusually
large file-sizes), encoded with jpeg-quality 75,
and 4:2:2-colour-subsampling (the format currently used
for encoding images), can be below 60 kB at 227x227.
For the lower file-size-limit of 20 kB,
such images with a resolution of 128x128 already fit.
More normal images will have a lower file-size at the same resolution.
Before this change, the target-resolutions for resizing were:
512x512 -> 341x341 -> 227x227.
And for the lower file-size-limit:
128x128 (does already fit).
After this change, the target-resolutions for resizing will be:
512x512 -> 448x448 -> 392x392 -> 343x343 -> 300x300 -> 263x263 -> 230x230.
And for the lower file-size-limit, those will be:
256x256 -> 224x224 -> 196x196 -> 172x172 -> 150x150 -> 131x131.
The resolution-limit has been increased to 256x256, because the file-size
of many images is still smaller than 20 kB when encoded at 256x256,
and it can be a large improvement in quality.1 parent f12afdf commit a32210d
2 files changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
486 | | - | |
| 486 | + | |
| 487 | + | |
487 | 488 | | |
488 | 489 | | |
489 | 490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
0 commit comments