Commit f48792b
committed
feat: Optimize avatar size multiplier for
Instead of 2/3 which is not optimal for 512 px avatars usually passed to Core, use the sequence 7/8,
6/8, 11/16, 10/16... to do "smaller" downscaling steps and reduce aliasing effects.
Before, it was discussed that just 3/4 can be used. However:
- If we repeat the downscaling step, we get `3 ** n` as a numerator and this way increase aliasing
effects on each step. The same for 7/8. Better limit the numerator value.
- As we do downscaling in a loop only for avatars which aren't changed frequently, let's do
"smaller" steps and start from 7/8.2 << n px avatars1 parent ef718bb commit f48792b
3 files changed
Lines changed: 26 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
| 438 | + | |
| 439 | + | |
438 | 440 | | |
439 | 441 | | |
440 | 442 | | |
| |||
467 | 469 | | |
468 | 470 | | |
469 | 471 | | |
470 | | - | |
471 | | - | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
472 | 477 | | |
473 | 478 | | |
474 | 479 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
239 | 241 | | |
240 | 242 | | |
241 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
242 | 260 | | |
243 | 261 | | |
244 | 262 | | |
| |||
Loading
0 commit comments