Skip to content

fix: encode avatars at AVIF quality 75, not sharp's default 50 - #350

Merged
grytchat merged 1 commit into
mainfrom
claude/avatar-quality
Oct 28, 2026
Merged

grytchat merged 1 commit into
mainfrom
claude/avatar-quality

Conversation

@grytchat

Copy link
Copy Markdown
Contributor

Sivert noticed the avatars in chat look soft, the bot's owl in #testing among them. The 256 px avatar on the community server is 1.8 KB.

storeAvatarPicture encoded avatars and banners with .avif(), which is sharp's default of quality 50, and their thumbnails with quality: 50 spelled out. At 128 px, which is what chat, the member list and the server rail load, quality 50 blurs the edges of a flat drawing. All five now use AVATAR_QUALITY = 75 in constants/media.ts. It's still the same pixel size.

Not covered: pictures already stored keep their quality 50. The image worker rebuilds a thumbnail only when thumbnail_px changes, and the full-size file is the only copy. People who want a sharper avatar re-upload it.

webhookAvatar and uploadQuarantine tests pass, and lint and the comment check are clean.

🤖 Generated with Claude Code

Avatars, banners and their thumbnails went through sharp's AVIF default of
quality 50. On a flat drawing like the owl that softens every edge, and the
128 px chat thumbnail shows it most: a 256 px avatar came out at 1.8 KB.
Quality 75 is a few KB more per picture.

Only new uploads get it. The thumbnails already stored are rebuilt only when
their size changes, not their quality.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@grytchat
grytchat merged commit 6132ace into main Oct 28, 2026
7 checks passed
@grytchat
grytchat deleted the claude/avatar-quality branch October 28, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant