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

Compressing images for better performance #712

Closed
Elgayar opened this issue Dec 26, 2016 · 11 comments
Closed

Compressing images for better performance #712

Elgayar opened this issue Dec 26, 2016 · 11 comments

Comments

@Elgayar
Copy link
Member

Elgayar commented Dec 26, 2016

The website is painfully slow as mentioned in issue #632 by @robbyoconnor
I opened this issue in order to discuss methods of compressing images on the website (preferably lossless compression).

I came across that API: https://imageoptim.com/api/start
Can you guys please take a look and say your opinion about it and if I should try using it?

@abishekvashok
Copy link
Member

I am ok with it, if the community is ok i would like to work on this, this is how I plan to go ahead:
We will check the image sizes and dimensions using the ImgChecker and if the size is large we will optimize it and if the dimensions are large and are in aspect ratio 1:1 we will resize it, thus we will have more automation. So what are your suggestions shall I proceed pls.

@robbyoconnor
Copy link
Contributor

@Abhi2424shek -- just add the check -- keep the structure I have set up

@robbyoconnor
Copy link
Contributor

Fail it if it's not optimized...I'd rather not push changes like that. Give students pointers in how to opitmize the images themselves.

@abishekvashok
Copy link
Member

abishekvashok commented Dec 27, 2016

@robbyoconnor ok sir then we will not push changes back!

@ankitrgadiya
Copy link
Member

ankitrgadiya commented Dec 31, 2016

@Abhi2424shek @robbyoconnor @Elgayar We can use Shrinkray.io

@abishekvashok
Copy link
Member

@ankitrgadiya @robbyoconnor @Elgayar what should be the maximum image size shall we fix it as 1mb.

@ankitrgadiya
Copy link
Member

@Abhi2424shek Are you talking about 1mb for all images or 1mb/picture?
If 1mb/picture that's a lot, we have tons of images site will weight a lot.
And if you're talking about 1mb for all images, we cannot fix the size as more students with more pictures are contributing, it will be very irritating to limit it.
This is my opinion guys.

@Elgayar
Copy link
Member Author

Elgayar commented Dec 31, 2016

The images are already maximum 200 KB, so you're giving more than double what they need.
If the average size of the images is 200KB for example, then we should limit all images by compression to 150 KB for example, even if that will reduce quality.. @ankitrgadiya @Abhi2424shek

@ankitrgadiya
Copy link
Member

@Elgayar 150kb is alot. All pictures in Students and Mentors section should be no more than 20kb, which most of them already are. And about Blog section the images should not be more than 50kb.
And I know we need to give priority to size but we have to keep in mind that extremely low quality images will not look good as well. Also I'd like to add that, as pictures were added by different students and later manipulated but a lot of people, so few images even though slightly larger in size are extremely low quality.

Check this one
screenshot from 2017-01-01 11-23-57

First image in low quality compared to second one. But guess what first one is around 32kb and second one is just 14kb. We have to do things like this.

@abishekvashok
Copy link
Member

@ankitrgadiya @Elgayar then we will fix the cap at 100 kb for student's mentor's and project's images and a 200 kb for blog images...
Is that ok @robbyoconnor
We would make Travis to fail by exiting with value other than 0 and print out all those images are bigger than the size specified. If the size is ok I would just deliver a quick PR!

@abishekvashok
Copy link
Member

Hey someone already did this using shrinkray.io and are pushing back... So can we close this then I think it's @gaeun who did it anyways good work.

@m1guelpf m1guelpf closed this as completed Jan 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants