Skip to content
🖥 Show high resolution images on your terminal !
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
bin
images
lib
spec
.rspec
.rubocop.yml
CODE_OF_CONDUCT.md
Gemfile
Gemfile.lock
Guardfile
LICENSE.txt
README.md
Rakefile
terminal_image.gemspec

README.md

TerminalImage

Gem Version Circle CI Code Climate codecov Libraries.io dependency status for GitHub repo GitHub

TerminalImage is a library to show images on terminals. Currently, this library supports iTerm2 and terminals with libsixel installed.

Installation

Add this line to your application's Gemfile:

gem 'terminal_image'

Terminals other than iTerm2:

Please install libsixel's img2sixel command following https://github.com/saitoha/libsixel#install

Usage

# 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 code of conduct.

License

The gem is available as open source under the terms of the MIT License.

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.

You can’t perform that action at this time.