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

Reduce image sizes #228

Open
mikatuo opened this issue Nov 9, 2024 · 6 comments
Open

Reduce image sizes #228

mikatuo opened this issue Nov 9, 2024 · 6 comments

Comments

@mikatuo
Copy link

mikatuo commented Nov 9, 2024

Current images folder in the repo is a bit too large. Not sure if there are specific requirements for the images as far as their width & height are concerned. Probably a simple solution would be to compress existing images manually and then have requirements for new images to be "no more than X by X pixels" and "no more than X KB"?

image

which makes https://defold.com/assets/ page to be slow to load

image

In my specific case I would like to download the entire repo https://github.com/defold/asset-portal/archive/master.zip which is not feasible for my use case as the master.zip is ~50 MB so it takes quite some time. So as a workaround I have to download each .json file one by one (~260 of them) which could be slow as well.

@mikatuo
Copy link
Author

mikatuo commented Nov 9, 2024

Related to defold/defold.github.io#24

@AGulev
Copy link
Contributor

AGulev commented Nov 10, 2024

I made a couple of changes:

  • image compression for PNG files with alpha
  • replace nontransparent PNGs with JPGs
    CleanShot 2024-11-10 at 11 02 44@2x

@AGulev
Copy link
Contributor

AGulev commented Nov 10, 2024

Maybe it's not perfect but almost twice better.
CleanShot 2024-11-10 at 11 11 31@2x

@britzl
Copy link
Collaborator

britzl commented Nov 10, 2024

We should also set images to loading="lazy" but this requires changing from <div background to <img. I will look into this.

@britzl
Copy link
Collaborator

britzl commented Nov 10, 2024

I will look into this.

defold/defold.github.io@6de395f

@AGulev
Copy link
Contributor

AGulev commented Nov 10, 2024

I will look into this.

defold/defold.github.io@6de395f

works for me:

CleanShot.2024-11-10.at.15.22.12.mp4

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

No branches or pull requests

3 participants