Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize background image #1068

Merged
merged 2 commits into from
Sep 7, 2024
Merged

Optimize background image #1068

merged 2 commits into from
Sep 7, 2024

Conversation

SapiensAnatis
Copy link
Owner

Split the background images into wide and narrow variants so that we don't end up loading the full image where half of it will not be seen because of screen size.

The previous images were 384 KB for light mode, and 229 KB for dark mode. The new images are 145 KB / 166 KB for narrow/wide in light mode, and 83.8 KB / 104 KB for narrow/wide in dark mode. So savings of about 50%.

Also looked into using enhanced:img but think this is a non-starter if we want to load different images based on CSS media queries

Split the background images into wide and narrow variants so that we
don't end up loading the full image where half of it will not be seen
because of screen size.

The previous images were 384 KB for light mode, and 229 KB for dark
mode. The new images are 145 KB / 166 KB for narrow/wide in light mode,
and 83.8 KB / 104 KB for narrow/wide in dark mode. So savings of about
50%.

Also looked into using <enhanced:img> but think this is a non-starter
if we want to load different images based on CSS media queries
@SapiensAnatis SapiensAnatis merged commit ce69b82 into main Sep 7, 2024
2 checks passed
@SapiensAnatis SapiensAnatis deleted the fix/bg-image branch September 7, 2024 21:11
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