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

Add Windows Support #3

Open
thiagodp opened this issue Oct 24, 2017 · 21 comments
Open

Add Windows Support #3

thiagodp opened this issue Oct 24, 2017 · 21 comments

Comments

@thiagodp
Copy link

thiagodp commented Oct 24, 2017

Hi, are you planning to make npm-gif available for other OSes' terminals? Thanks!

@kodie
Copy link
Owner

kodie commented Oct 24, 2017

Hi @thiagodp! I would love to. However, the limitation is in the terminal itself. The terminal has to support embedding images and as far as I know iTerm2 is the only one that currently does.

@thiagodp
Copy link
Author

thiagodp commented Oct 25, 2017

I see...
Since other terminals only support ascii, it would be necessary to do some kind of ascii art or braille animation. So definitively, to simulate this would be a task for a different project (not a gif-based).
Thank you, anyway!

@thiagodp
Copy link
Author

BTW, I just found an ascii art -based gif cli.

@benwiley4000
Copy link

benwiley4000 commented Dec 6, 2017

Definitely lower-res than the real image, but here are some pure-JavaScript options for getting some version of the image in non-iTerm2 terminals:

  • The picture-tube module makes it easy to pipe a PNG write stream (one of the gif-frames output stream options) into the terminal window as ansi terminal characters... however I don't think that really lets you replace a specific region of the terminal window.
  • For finer control you can use picture-tube's dependency, charm, which lets you set a specific terminal character position equal to a color value.
    • For this one you would need access to the decoded data, so you could either re-decode the output frames from gif-frames using get-pixels, or just use get-pixels to decode the GIF in the first place.

More work, but would be cool. 😄

@benwiley4000
Copy link

benwiley4000 commented Dec 6, 2017

Also looks like image-to-ascii would be perfect for this (much higher res than just color blocks)... if it supported file streams or Buffers!

@kodie
Copy link
Owner

kodie commented Dec 6, 2017

@benwiley4000 Very interesting! Think I may have to switch progress-img's default fallback to image-to-ascii!

@benwiley4000
Copy link

@kodie I looked and the underlying image parsing engine (lwipify) actually seems to support Buffer objects so I think you could supply one of those as the source argument to imageToAscii.

@kodie
Copy link
Owner

kodie commented Dec 6, 2017

@benwiley4000 I've been playing around with image-to-ascii and it does in fact support buffers right out of the box luckily.

@benwiley4000
Copy link

Good to hear!

@thiagodp
Copy link
Author

thiagodp commented Dec 6, 2017

Great!

@kodie
Copy link
Owner

kodie commented Dec 7, 2017

@benwiley4000 @thiagodp The biggest thing stopping me from implementing this is that image-to-ascii relies on image-parser which requires GraphicsMagick to be installed on the user's system.

Which means that if implemented and a user runs npm install npm-gif, the install will fail unless they have GraphicsMagick installed on their system.

@benwiley4000
Copy link

benwiley4000 commented Dec 7, 2017

@kodie this one has no native dependencies. https://github.com/ajay-gandhi/asciify-image

Like the other module, it claims it takes a string path but I think a Buffer will work since it relies on lwip.

@kodie
Copy link
Owner

kodie commented Dec 13, 2017

@benwiley4000 Unfortunately lwip doesn't support modern node versions quite yet :( EyalAr/lwip#297

@benwiley4000
Copy link

benwiley4000 commented Dec 13, 2017

Aaah. Also I'm realizing the "no native dependencies" is a lie since lwip has some. ETA: The only advantage I guess is that you don't need to count on the user to install anything manually, but it's still prone to issues when you change Node versions, as with all C++ bindings.

@kodie
Copy link
Owner

kodie commented Jan 5, 2018

@thiagodp @benwiley4000 I have made a pull request for asciify-image that would make it truly dependency-free so if that gets merged we'll be in business!

@benwiley4000
Copy link

Awesome! Looking forward to what comes next.

@kodie
Copy link
Owner

kodie commented Jan 11, 2018

@benwiley4000 @thiagodp Please install the new release (v1.0.2) and give it a try!

@Fridus
Copy link

Fridus commented Jul 27, 2018

Hi,
Not working with mac OS terminal
capture d ecran 2018-07-27 a 11 00 48

And the image appears after installing the packages on iTerm2

✗ npm --version
6.1.0

iTerm 3.1.7

@thiagodp
Copy link
Author

Hi, @kodie , sorry for giving you feedback so late...

Anyway, this was the result on Windows 10:

image

The ascii appeared at once.

@kodie
Copy link
Owner

kodie commented Aug 10, 2018

@thiagodp No worries, thank you for the feedback. I will look into this.

@blogdopata
Copy link

Git bash too :(

@kodie kodie changed the title Support to other OSes Add Windows Support Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants