Open Bug 1182325 Opened 9 years ago Updated 2 years ago

Embedded bitmaps inside SVG are scaled poorly

Categories

(Core :: Graphics: ImageLib, defect)

41 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: tigt, Unassigned)

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:41.0) Gecko/20100101 Firefox/41.0
Build ID: 20150708004005

Steps to reproduce:

1. Make an inline <svg>
2. Put an <image> pointing to a bitmap inside of it
3. Scale the SVG down.


Actual results:

The downscaled bitmap <image>s are resized with a quick-and-dirty algorithm, which looks bad. (SVG <image>s aren't affected.)

The effect worsens if the bitmap is scaled down in a secondary step by setting its width and height attributes to something other than its natural width & height.


Expected results:

Ideally some sort of more-sophisticated resampling should happen. image-rendering: optimizeQuality doesn't do anything, but the current scaling algorithm would be a fine candidate for optimizeSpeed.

Chrome has an improved sampling algorithm, but tends to make images in this situation look like they're covered with vaseline.
Component: Untriaged → ImageLib
Product: Firefox → Core
Whiteboard: [gfx-noted]
An additional test-case from the Chromium issue tracker (they have the opposite problem, <image> is too blurry):

http://demo.ceros.com/examples/image-masking/blurry-svg.html

It's more obvious with the photographic image that Firefox may be downsampling at the wrong point in the graphics pipeline, or something.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: