Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement offthread image rendering. #18

Open
paales opened this issue Jul 3, 2017 · 2 comments
Open

Implement offthread image rendering. #18

paales opened this issue Jul 3, 2017 · 2 comments

Comments

@paales
Copy link
Contributor

paales commented Jul 3, 2017

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.

@mlisook
Copy link
Owner

mlisook commented Jul 3, 2017

Well, that is really cool.

I do want to maintain plastic-image as a superset of iron-image so there is a bit of complexity dovetailing with iron-image's 2 existing ways of displaying the image (img tag and background-image of the containing div) and adding a new way by inserting a canvas into the template. Also, iron-image has a fair amount of state tracking that plastic-image doesn't really have to deal with.

I certainly think it's worth an experimental build.

@paales paales changed the title Reduce scroll jank while rendering images. Implement offthread image rendering. Aug 9, 2017
@mlisook
Copy link
Owner

mlisook commented Oct 7, 2017

@paales In case you missed it ... from the chomium project: Intent to Implement: image async attribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants