microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.21k stars 6.44k forks source link

[Image Resizer] Resized image is blurry #10675

Open Pingumania opened 3 years ago

Pingumania commented 3 years ago

Microsoft PowerToys version

0.35.0

Running as admin

No

Area(s) with issue?

Image Resizer

Steps to reproduce

I took a random screenshot and resized it with Image Resizer and Paint to have a width of 600. I used 95 jpeg quality and "fit 600x600 pixel". The measurements of the orignal screenshot are 1213x750. The measurements of the Paint image are 600x370. The measurements of the Image Resizer one are 600x371.

Here are the images Original

Image Resizer

Paint

✔️ Expected Behavior

The Image Resizer picutre shouldn't be blurry.

❌ Actual Behavior

The picture from the Image Resizer is blurry compared the one from Paint.

Other Software

No response

crutkas commented 3 years ago

Notes:

crutkas commented 3 years ago

doing the tweak i think is easy, doing the testing here is where most of the time will be spent.

need to validate

validate we didn't break other formats

Jay-o-Way commented 3 years ago

What kind of algorithm does Image Resizer use? Is it always the same or can we use different for enlargement versus smaller?

Kissaki commented 4 months ago

To add a data point with more details - anime screenshot:

Even with the same quality settings (confirmed with Irfanview on the exported images) JPEG, quality: 90, subsampling ON (2x2) the GIMP-resized file looks significantly better, significantly less blurred.

Alternating the scaling interpolation in GIMP in all cases (None, Linear, Cubic interpolation) looks better. (Linear looks worse than Cubic, but still better than Image Resizer. None has no blur.)

Kissaki commented 4 months ago

Project ImageResizerUI, ResizeOperation.Transform creates a System.Windows.Media.Imaging.TransformedBitmap with a ScaleTransform argument.

From what I can see, the blurring issue limitation is a given from that standard lib. I don't see any parameters beyond the scale factors/transformation matrix.

reference docs

Kissaki commented 4 months ago

I would appreciate feedback in draft PR #32797