Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Client side resize bad aliasing depending on browser #3721

Open
redemption opened this issue Apr 6, 2021 · 2 comments
Open

Client side resize bad aliasing depending on browser #3721

redemption opened this issue Apr 6, 2021 · 2 comments
Labels

Comments

@redemption
Copy link
Contributor

redemption commented Apr 6, 2021

Hello,

This is not so much a "bug" as trying to learn about something we observe and maybe understanding if there can be improvements.

We use client side resize in jquery upload to resize images to around 1200x825px height.

We've noticed that Firefox and Chrome have noticeably different image quality after resize, but both leave much more aliasing in angled lines than server side Imagick does with its default filters (Lanczos or Mitchell).

Is this something that can be improved somehow? Are some browsers better than others with client side resize, and what are they?

I took an image and uploaded with client side resize off, then with it "on" in Chrome and Firefox, and I cropped out a section from each sample to demonstrate the most obvious artifacts:

example_resize_jqueryupload

The angled line is the most obvious, but even if you look at the "psb speakers" logo you can clearly see the Imagic resize is cleaner than the other two, especially compared to Firefox which has the worst resize.

Is there any way to set the client side resize to use better or different resize algorithms?

@redemption redemption changed the title Client side resize aliasing depending on browser Client side resize bad aliasing depending on browser Apr 6, 2021
@redemption
Copy link
Contributor Author

I wanted to update this with more information that I gathered from more testing:

  • It looks like the Javascript-Load-Image library uses imageSmoothingQuality at default value of "low". I did some testing of "medium" and "high" settings for imageSmoothingQuality and would like to propose that jQuery-File-Upload exposes imageSmoothingQuality in its configuration to give a bit more control over smoothing on resize. I've made a pull request with the example proposed change: Image smoothing quality #3722
  • Firefox does not support imageSmoothingQuality, is there any chance that the Javascript-Load-Image library could be updated to use a JS based high quality downsampler for Firefox and Internet Explorer? eg https://stackoverflow.com/a/65448582/487899

@blueimp
Copy link
Owner

blueimp commented Sep 25, 2021

Thanks for your investigation @redemption and your pull request (which I have just merged).
To answer your last question as well, I don't have plans to add a JS based downsampler for the JavaScript Load Image library at the moment, my aim is to rely on browser features as much as possible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants