https://github.com/unhappychoice/terminal_image
:desktop_computer: Show high resolution images on your terminal !
https://github.com/unhappychoice/terminal_image
cli command-line command-line-tool high-resolution image iterm2 library libsixel ruby terminal
Last synced: 3 months ago
JSON representation
:desktop_computer: Show high resolution images on your terminal !
- Host: GitHub
- URL: https://github.com/unhappychoice/terminal_image
- Owner: unhappychoice
- License: mit
- Created: 2019-09-16T02:12:21.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-22T01:19:54.000Z (9 months ago)
- Last Synced: 2024-10-23T01:02:25.117Z (8 months ago)
- Topics: cli, command-line, command-line-tool, high-resolution, image, iterm2, library, libsixel, ruby, terminal
- Language: Ruby
- Homepage:
- Size: 1.51 MB
- Stars: 32
- Watchers: 5
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# TerminalImage
[](https://badge.fury.io/rb/terminal_image)
[](https://codeclimate.com/github/unhappychoice/terminal_image)
[](https://codecov.io/gh/unhappychoice/terminal_image)
[](https://libraries.io/github/unhappychoice/terminal_image)

TerminalImage is a library to show images on terminals.
Currently, this library supports [iTerm2](https://iterm2.com/index.html) and terminals with [libsixel](https://github.com/saitoha/libsixel) installed.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'terminal_image'
```Terminals other than iTerm2:
Please install `libsixel`'s `img2sixel` command following https://github.com/saitoha/libsixel#install
## Usage
```ruby
# Print image by File object
TerminalImage.show(File.open('your-image-path.png'))# Print image from URL
TerminalImage.show_url('https://raw.githubusercontent.com/unhappychoice/terminal_image/master/images/sample.png')# Get encoded string ready to be displayed
string = TerminalImage.encode(File.open('your-image-path.png'))# Get encoded string ready to be displayed from URL
string = TerminalImage.encode_url('https://raw.githubusercontent.com/unhappychoice/terminal_image/master/images/sample.png')
```## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/unhappychoice/terminal_image. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
## Code of Conduct
Everyone interacting in the TerminalImage project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/unhappychoice/terminal_image/blob/master/CODE_OF_CONDUCT.md).