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

fix(website): resize images to width 640 #6042

Closed
wants to merge 1 commit into from

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Dec 3, 2021

Motivation

See also #5980

640 seems like a good baseline to resize showcase images and the smallest image size found atm.

It's unlikely we'll render those images above 600px anyway even on Retina.

For favorite sites, we may need higher res screenshots later but we can easily redo them.

Using mogrify -resize 640 website/src/data/showcase/*.png -quality 100%

Not 100% sure it's a good way for now.

Quality seems worst (not sure? will see in preview) than before and some items are heavier than before 🤷‍♂️

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

preview

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Dec 3, 2021
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Dec 3, 2021
@netlify
Copy link

netlify bot commented Dec 3, 2021

✔️ [V2]

🔨 Explore the source changes: 1822afd

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61aa32480eaabc000775dcc8

😎 Browse the preview: https://deploy-preview-6042--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Dec 3, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 93
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-6042--docusaurus-2.netlify.app/

@github-actions
Copy link

github-actions bot commented Dec 3, 2021

Size Change: 0 B

Total Size: 656 kB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 40.1 kB
website/build/assets/css/styles.********.css 101 kB
website/build/assets/js/main.********.js 485 kB
website/build/index.html 29.5 kB

compressed-size-action

@Josh-Cena
Copy link
Collaborator

Seems some images have been upscaled? Or is it just because of deoptimisation...

@Josh-Cena Josh-Cena added pr: documentation This PR works on the website or other text documents in the repo. and removed pr: bug fix This PR fixes a bug in a past release. labels Dec 3, 2021
@armano2
Copy link
Contributor

armano2 commented Dec 3, 2021

biggest difference in metadata of those images is palette used, rn, you are encoding them in full rgb

@slorber slorber marked this pull request as draft December 3, 2021 15:33
@slorber
Copy link
Collaborator Author

slorber commented Dec 3, 2021

yes it doesn't look good to merge 😅

I don't think images are upscaled but the output does not seem optimized. If someone want to take a look let me know. CLI tools are not so good it seems (or I'm using the wrong options?) or we have to chain multiple of them to have a decent output 🤷‍♂️

@armano2
Copy link
Contributor

armano2 commented Dec 3, 2021

what do you think about:

mogrify -filter Triangle -define filter:support=2 -resize 640 -unsharp 0.25x0.25+8+0.065 -dither None -posterize 136 -quality 100 -colors 255 -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB -strip website/src/data/showcase/*.png

you could always keep original images and output compressed one with -path PATH

@slorber
Copy link
Collaborator Author

slorber commented Dec 3, 2021

🤯 I have no idea :D If you want to open another PR we can see if the preview and diff size is good ;)

@armano2
Copy link
Contributor

armano2 commented Dec 3, 2021

i opened new pr #6043

@slorber slorber closed this Dec 8, 2021
@Josh-Cena Josh-Cena deleted the slorber/resize-showcase-images branch December 8, 2021 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: documentation This PR works on the website or other text documents in the repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants