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

Add WebP support #151

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
5 participants
@dhorytskyi
Copy link

commented Apr 22, 2019

Problem

Speed up a page load using another image format with smaller size.

Solution

Convert and resize loaded images to the WebP format. Send the WebP image if the browser supports it.

Requested Reviewers

@DrewML

@magento-cicd2

This comment has been minimized.

Copy link

commented Apr 22, 2019

CLA assistant check
All committers have signed the CLA.


#### Component Dependencies

This functionality requires an asynchronous image resizing to avoid degradation on adding images to the gallery and resizing all images.

This comment has been minimized.

Copy link
@roma-glushko

roma-glushko Apr 24, 2019

How will the asynchronous image resizing be implemented? Is it going to be a separated async service that would be triggered by webserver to handle image requests?

This comment has been minimized.

Copy link
@dhorytskyi

dhorytskyi Apr 25, 2019

Author

Asynchronous image resizing hasn't been implemented yet.
But in my opinion, when a resized image does not exist, it should be resized in a synchronous way. Asynchronous resizing should be used for adding an image to a media gallery and for all images resizing.

@DrewML

This comment has been minimized.

Copy link
Member

commented Apr 25, 2019

Can we update the proposal to clarify whether this is for catalog images, wysiwyg uploads, or both? My understanding is that these are types are handled separately currently.

@dhorytskyi

This comment has been minimized.

Copy link
Author

commented Apr 27, 2019

I've updated it.
This proposal for catalog images, but it can be introduced for wysiwyg images as well.

@DrewML

This comment has been minimized.

Copy link
Member

commented Apr 29, 2019

We can probably only safely enable this for jpgs. Lossless png tends to end up larger as a lossless webp image, and we can't assume a store owner would want to convert from lossless >> lossy (png >> lossy webp).

@dhorytskyi

This comment has been minimized.

Copy link
Author

commented Apr 30, 2019

As it will be managed by config option, a store owner can decide does it make his images smaller with the same quality or not.

@michaelcasey316

This comment has been minimized.

Copy link

commented May 1, 2019

We can probably only safely enable this for jpgs. Lossless png tends to end up larger as a lossless webp image

I think the link only says that lossless PNG to lossy WebP (or any lossy to lossless) can increase file size. The issue with file size increasing on a conversion to lossy is because of YUV420 downsampling. Lossless WebP doesn't downsample colors, and near the bottom it states

Note that converting a JPEG source to lossy WebP, or a PNG source to lossless WebP are not prone to such file size surprises.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.