emilk / emilk/egui

Using the user agents capabilities for loading images on web

Open
#4,465 1 comment 0 reactions 0 assignees View on GitHub
web
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

**Is your feature request related to a problem? Please describe.**
There is no need for a full-on image parsing library on wasm builds, as the user agent integrates plenty of image parser. It's also possible to directly initialize images from such sources. Either through HTMLImageElement or ImageData.

This would improve the loading times, by removing the image parser running in wasm, and the delivery time of the wasm file itself, as the image crate itself is quite heavy.

**Describe the solution you'd like**

Switching over to using `HTMLImageElement`.

**Describe alternatives you've considered**

**Additional context**
Depends on https://github.com/gfx-rs/wgpu/pull/5668

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the wasm image-loading path and the dependency in wgpu PR #5668; the issue names no file or test. Compare the current wasm image parser with HTMLImageElement or ImageData, and consider the work done when web builds load images through the user agent without bundling the image parser.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, rust, wasm
Domain
frontend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.