IonicaBizau / image-to-ascii

:floppy_disk: A Node.js module that converts images to ASCII art.
http://ionicabizau.net/blog/16
MIT License
1.58k stars 105 forks source link

Stream version? #57

Closed benwiley4000 closed 6 years ago

benwiley4000 commented 6 years ago

Can this accept an image stream so images can be created on the fly? Maybe I missed something along the way.

IonicaBizau commented 6 years ago

I was thinking about a streaming interface, but I'm not sure how we should build it. How would you use the streaming interface?

benwiley4000 commented 6 years ago

Hm, well I guess I'm picturing:

imageStream
  .pipe(imageToAscii(options))
  .pipe(process.stdout);

Or some variation of that.

But the other thing that occurred to me is that source (to the normal version) should be either a string or a Buffer - that's actually probably more the question I really meant to ask. 😁

IonicaBizau commented 6 years ago

I guess in that case image-parser should be changed to support streaming.

Contributions are welcome, but I think that will be a big change... I'm open to ideas.

benwiley4000 commented 6 years ago

I see, thanks for the pointer! It would be very cool to be able to display arbitrary animations via terminal, similar to this.

benwiley4000 commented 6 years ago

@IonicaBizau would it be such a big change to at least support Buffers?

benwiley4000 commented 6 years ago

Looks like lwipify already supports buffers - the readme just needs to be updated here?

IonicaBizau commented 6 years ago

Buffers are supported already but docs were out of date. Thanks for updating them in #58.

To support streams the effort would be too big, but if anyone has ideas in this direction, they can comment here. We can reopen this issue in that case.