Commit 35930f3
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 accumulate aliasing
effects. Better limit it 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 b72a677 commit 35930f3
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
| 437 | + | |
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
| |||
466 | 467 | | |
467 | 468 | | |
468 | 469 | | |
469 | | - | |
470 | | - | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
471 | 481 | | |
472 | 482 | | |
473 | 483 | | |
| |||
0 commit comments