Commit abdfeb9
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 3/4,
5/8, 4/8, 3/8... to reduce aliasing effects. Also divide the original avatar size, not the Core
constant (which is 512 px currently), this makes sense if e.g. 640 px avatars are passed.
Before, it was discussed that just 3/4 can be used. However:
- If we repeat the reduction step, we get `3 << n` as a numerator and this way increase aliasing
effects on each step. Better limit the numerator to 5.
- If a 640 px avatar is passed, giving that `BALANCED_AVATAR_SIZE` is 512, 3/4 gives 384 i.e. 3/5 of
640 which is good but still worse than 3/4.2 << n px avatars1 parent 6a3ef20 commit abdfeb9
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
| 438 | + | |
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
| |||
467 | 468 | | |
468 | 469 | | |
469 | 470 | | |
470 | | - | |
471 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
472 | 482 | | |
473 | 483 | | |
474 | 484 | | |
| |||
0 commit comments