react-pwa-reference-storefront icon indicating copy to clipboard operation
react-pwa-reference-storefront copied to clipboard

[WIP] Image compression

Open dusanradovanovic opened this issue 4 years ago • 2 comments

Description:

I've converted all home-page images to jpeg format and compressed them without changing resolution. I was able to reduce their file size 8x~10x without losing visual fidelity. Here is the comparison of the Lighthouse report:

image

Linting:

  • [ ] No linting errors

Tests:

  • [ ] E2E tests (npm test run with e2e)
  • [ ] Manual tests

Documentation:

  • [ ] Requires documentation updates

dusanradovanovic avatar May 05 '20 07:05 dusanradovanovic

@dusanradovanovic moving to lossy JPEG is not going to be ideal for us as the quality of these images will suffer 😞 This is why we've been keeping png thus far, and compressing any new images with https://tinypng.com/.

Comparing a few of the converted images with their compressed png counterparts, there's a noticeable degradation of quality during compression (example: b2c-product-3.jpg, b2c-product-6.png).

Some options:

  • We could convert certain images to JPEG that we don't need to be scaled at higher resolutions (smaller marketing spots, etc).
  • Continue work with showing selective images at various breakpoints (srcset) and have different sized images for each breakpoint.

FYI @BonnieEP

shaunmaharaj avatar May 05 '20 13:05 shaunmaharaj

@dusanradovanovic moving to lossy JPEG is not going to be ideal for us as the quality of these images will suffer 😞 This is why we've been keeping png thus far, and compressing any new images with https://tinypng.com/.

Comparing a few of the converted images with their compressed png counterparts, there's a noticeable degradation of quality during compression (example: b2c-product-3.jpg, b2c-product-6.png).

Some options:

  • We could convert certain images to JPEG that we don't need to be scaled at higher resolutions (smaller marketing spots, etc).
  • Continue work with showing selective images at various breakpoints (srcset) and have different sized images for each breakpoint.

FYI @BonnieEP

@dusanradovanovic moving to lossy JPEG is not going to be ideal for us as the quality of these images will suffer 😞 This is why we've been keeping png thus far, and compressing any new images with https://tinypng.com/.

Comparing a few of the converted images with their compressed png counterparts, there's a noticeable degradation of quality during compression (example: b2c-product-3.jpg, b2c-product-6.png).

Some options:

  • We could convert certain images to JPEG that we don't need to be scaled at higher resolutions (smaller marketing spots, etc).
  • Continue work with showing selective images at various breakpoints (srcset) and have different sized images for each breakpoint.

FYI @BonnieEP

I am not seeing a huge difference between the png's beside the jpg's. From what ive been reading Jpgs are meant for photographic images where as pngs are more meant for graphical images where you need solid crisp borders. I agree with Shaun though that if the degredation is not acceptable we should change some of our less important and smaller images to be jpg.

aChanEP avatar May 05 '20 15:05 aChanEP