Skip to content

Image resize/scale - bitmap vs. image (findings) #319

Closed
@AndersMad

Description

@AndersMad

@mattleibow asks "What is the recommended way to resize bitmaps" here https://groups.google.com/d/msg/skia-discuss/r-2svp3dK_8/2MRh6HKyEQAJ

The response is to use Image and not Bitmap as Bitmap is on a route to obsolete. Thats a big FYI i spose. But when i tried using image vs. bitmap:

Bitmap: Using e.g. bmp.Resize(bmpDest, SKBitmapResizeMethod.Lanczos3) the result is very nice and beats System.Drawing in quality and size (and twice as fast).

Image: BUT when resizing an image using surface/canvas/paint and even with paint.IsAntialias = false and paint.FilterQuality = SKFilterQuality.High set - the result is pretty bad in blurriness - its smudgy: canvas.DrawImage(img, r1, r2, paint);

This might likely be a root Skia problem (or me overlooking something?) - but when considering that Chrome uses Skia for its canvas elements - the forum responses here is to make sure that anti-alias is turned off - so maybe there is a missing property for this? Or maybe its just the Skia lack of being able to set the resize method using image draw.

Anyone else bumped into this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions