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 images #4

Merged
merged 1 commit into from
Jul 31, 2017
Merged

Optimize images #4

merged 1 commit into from
Jul 31, 2017

Conversation

pepelsbey
Copy link
Contributor

Currently all images are not optimized at all: they all just PNGs with alpha transparency. I guess it gives perfect quality and you don’t have to bother while exporting assets. But it takes 2 MB to load a simple page. Way too much.

So what it did:

  1. Converted all images to JPG with decent compression (70-80%)
  2. Created 1x and 2x versions used in srcset attributes to load 2x only when it’s needed
  3. Fixed size in manifest.json: 600 instead of 512 (actual size of the picture)

What it gives:

  1. 463 KB on 1x screen (4,3 times less)
  2. 877 KB on 2x screen (2,2 times less)

…without any noticable regression.

I hope you’ll accept this PR and will be careful with your next project.

@lex111 lex111 self-requested a review July 28, 2017 17:54
@andrewda
Copy link
Member

Is the black outline around the white logos wanted?

@pepelsbey
Copy link
Contributor Author

I may have chosen the wrong matte color for white logo. Let me check.

Copy link
Member

@housseindjirdeh housseindjirdeh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pepelsbey I can't thank you enough for this, you're right - 2MB of assets on a simple landing page is unnecessary. I really appreciate you noticing and putting up a PR for this 🙏 . I plan on adding some images of the Android build app of the app when it's launched and I'll make sure to keep images compressed to a decent size.

Aside from @andrewda's comment, every thing looks good. Since the white logo is in the center of a dark circle it probably wouldn't be noticeable - but I'll let you take a look and see if the dark border can be removed. Otherwise this looks good 🙌

@pepelsbey
Copy link
Contributor Author

Sorry for delay: yes, I specifically optimized white logo to use #333333 color matte since it’s only used on such background and there’s no need in alpha transparency. I guess it’s good to go then :)

@housseindjirdeh
Copy link
Member

Awesome, again - thanks a million for this :)

@housseindjirdeh housseindjirdeh merged commit 7d98469 into gitpoint:master Jul 31, 2017
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.

4 participants