Skip to content

[Image Preview for HTML Images] Interaction with progressively loading images #1403

Open

Description

Every format can display something while the image is loading, either a slice, or a full scan at lower quality.

When previewsrc is used, when is the full image displayed?

I suspect it's when the full image's final state is available, but the explainer doesn't make this clear.

Activity

  1. added
    Image Preview
    on Sep 23, 2026
  2. ogerchikov commented on Oct 2, 2026

    @ogerchikov
    Member

    Thanks, this is not clear enough in the explainer.

    Existing script-based implementations commonly preload the final image and wait for img.decode() before replacing or revealing it. I think the native proposal should follow the same model when the preview is displayed.

    If the preview becomes ready first, it is displayed and remains visible until the final image is completely available and decoded for presentation. The final image then replaces the preview in one step.

    If the final image produces paintable content before the preview is displayed, the browser displays that content and permanently skips the preview. Progressive or incremental updates then render normally.

    I’ll update the explainer to make this behavior explicit.

  3. ogerchikov commented on Nov 7, 2026

    @ogerchikov
    Member

    I’ve revised the behavior in my earlier reply, mainly to align it with the independent CSS styling sketch. That design can style waiting content, previews, and the main image, including when no preview is provided. A choice to wait for a complete decoded first frame should therefore apply consistently to both waiting-to-image and preview-to-image handoffs, rather than being imposed only when a preview appears.

    Waiting for a complete frame may be preferable for some effects, but not every loading experience. The core now preserves native presentation timing, while the exploratory image-reveal sketch separates that timing choice from styling. The mechanism is still open for discussion.

    Reopenning the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Image Preview

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions