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.
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.