Closed Bug 854441 Opened 11 years ago Closed 11 years ago

prefer downscaling a larger icon rather than upscaling a smaller one, if exact size is not available


(Core :: Graphics: ImageLib, defect)

Not set





(Reporter: jfkthame, Assigned: jfkthame)


(Blocks 1 open bug)



(3 files)

This is a followup to bug 419588 - as suggested in comments there, I think we should choose the next-largest icon size if the exact size requested isn't available, rather than choosing the -nearest- size. In general, downscaling is likely to look better than upscaling.

This will particularly affect Windows, where we may want favicons at 20x20 or 24x24 (for 125% or 150% resolution scale factors); in the (common) case where the favicon exists in 16x16 and 32x32 sizes (targeted at Retina displays), it's better to downscale the larger one than upscale the 16x16 version.

We could consider further refining this to prefer a -slight- upscale over a -large- downscale, but I suggest we try the simpler always-prefer-downscaling option first, and see how that looks.
Attachment #729006 - Flags: review?(seth)
The and Google tabs here show the kind of improvement we can get (in conjunction with the patch from bug 828508) if we favor downscaling a larger icon instead of upscaling a smaller one.

The upper image shows the tab titles with bug 828508 but -without- the patch here, so that the request for 20x20 icons will return the 16x16 versions, while the lower image uses this patch and so returns the 32x32 versions of the icons. These come out -much- crisper when scaled to the final size.
Sorry, forgot to clarify: the above comparison is for Windows resolution scale 125% - that's why we need 20x20-pixel favicons for the tab titles.
Similar to the 125% comparison above, but for the 150% setting. Again, the lower version of the screenshot shows the CNN and Google favicons with this patch to make us take a larger image and downscale it, instead of upscaling the 16x16 version.
OS: Mac OS X → All
Comment on attachment 729006 [details] [diff] [review]
patch, always prefer a larger icon size if exact match not found

Review of attachment 729006 [details] [diff] [review]:

Looks good!
Attachment #729006 - Flags: review?(seth) → review+
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.