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

Streaming Image encoders #1219

Open
lovasoa opened this issue May 17, 2020 · 1 comment
Open

Streaming Image encoders #1219

lovasoa opened this issue May 17, 2020 · 1 comment

Comments

@lovasoa
Copy link
Contributor

lovasoa commented May 17, 2020

I would like to be able to encode images that do not fit in memory.

My specific use case for this functionality is dezoomify-rs, which handles very large images directly on users' machines with limited memory.

This is more generally applicable to any application handling large images.

Draft

Several image encoders do already provide a streaming encoder:

Some others do not, but have a structure that simply iterates on an image's pixels which should make it easy to implement, such as

It would be awesome if image-rs could provide a simple interface that would abstract away each individual codec implementation and provide a generic streaming image encoder. The encoder would be created by specifying the image size, then would have a method allowing to add pixels to it. The pixels would be optionally buffered based on the underlying image codec's chunk size requirements, then provided to it.

lovasoa added a commit to lovasoa/image that referenced this issue May 24, 2020
…te slice

This change allows users to encode jpeg images from other sources
than memory, thus finally allowing the encoding of images that
do not fit in memory.

This also allows users to make the encoder work in a streaming fashion.
(see image-rs#1219)

This also finally allows encoding images from other pixel formats than
8-bit RGB. The conversion to 8bit YCbCr (used in JPEG) is done on the fly
during encoding.
@HeroicKatora HeroicKatora mentioned this issue Feb 13, 2021
22 tasks
@birktj
Copy link
Member

birktj commented Mar 6, 2021

See also #867

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

No branches or pull requests

2 participants