Skip to content

Implement offthread image rendering. #18

@paales

Description

@paales

Since this library is already pretty awesome and I thought it could use more awesome features: Render Images Off Thread.

Decoding images for use with a canvas is pretty common, whether it’s to allow users to customize an avatar, crop an image, or just zoom in on a picture. The problem with decoding images is that it can be CPU intensive, and that can sometimes mean jank or checkerboarding.

https://developers.google.com/web/updates/2016/03/createimagebitmap-in-chrome-50
https://github.com/GoogleChrome/offthread-image

Decoding an image Offthread will reduce scroll jank when loading the page because the main thread will have to do less.

Example how to implement in a custom element:
googlearchive/offthread-image#1
robdodson/offthread-image@9e517a0

I don't have any benchmarks so I can't say if this will actually improve performance, but it might be worth considering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions