+
Skip to content

Avoid encoding images after manipulation (image_pixels & Image::from_texture()). #57

@THEGOLDENPRO

Description

@THEGOLDENPRO

Egui has the ability to load image from a so called texture. Textures in egui give us the ability to draw stuff to the window from an array of pixels instead of image bytes.

Roseate is already decoding images to rgba pixel arrays for downsampling but right now it's encoding it again back to image bytes just to load it into egui. That sounds a massive waste of CPU time as from my understanding egui would have to decode the image again anyways to plot it's pixels into the GUI.

I think completing this issue will significantly boost image load time as right now one of the big blockers in load time is image encoding and decoding and also what I noticed recently, the time it takes passing the image to egui.

Some concerns

But before we go head over heels and implement this we need to take the size of rgba image pixels in memory into consideration and compare it with image bytes to see if we are loosing on the memory side of things.

Then we must also see how this will effect SVG files and most concerning GIFs.

Self Notes

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载