GithubHelp home page GithubHelp logo

huckdirks / img2xterm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rossy/img2xterm

2.0 0.0 0.0 60 KB

Displays images on your 256-color terminal with Unicode block characters.

Home Page: http://img2xterm.sooaweso.me

License: Creative Commons Zero v1.0 Universal

C 79.61% Makefile 11.60% Roff 8.79%

img2xterm's Introduction

img2xterm: display images on the terminal

img2xterm is a program that can display bitmap images on 256-colour terminals by converting them into Unicode block characters and xterm compatible control sequences. Based on software by [lachs0r] 1 and Xebec for creating colourful [cowfiles] 2, img2xterm improves on the colour selection and block printing logic, providing cleaner output on terminals with nice bitmap fonts.

This is an example of a cowfile created with img2xterm's --cow option:

Example of img2xterm in action.

img2xterm uses a modified version of the algorithm used in [xterm256-conv] 3 in order to have an accurate representation of the upper 240 colours used in xterm. Modification was needed in order to fix the range of the grey ramp.

Dependencies

Before compilation, make sure you have development versions of [ImageMagick] 4 (for MagickWand), [Ncurses] 5 (for terminfo support), and [pkg-config] 6 (required to properly link MagickWand).

Getting img2xterm

The GNU Autotools are not required. To compile and install from source, simply run:

$ make
# make install

A [GIMP] 6 palette containing the upper 240 colours used in xterm is also available. It can be used for dithering images before conversion. To install, run:

$ cd extra/
$ make
$ cp xterm-256color.gpl ~/.gimp-2.6/palettes/

Converting images

To display an image on a compatible 256-color terminal:

$ img2xterm image.png

img2cow is a symlink to the img2xterm command. When invoked in this way, the program behaves as if the --cow option was used.

To generate a cowfile:

$ img2cow image.png image.cow
# cp image.cow /usr/share/cows

Known issues

  • There is something wrong with the implementation of [CIE94 delta-E] 8.
  • ImageMagick can be glitchy. Perhaps using libpng would be a better idea.

Copying

To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.

CC0

img2xterm's People

Contributors

rossy avatar keithw avatar huckdirks avatar

Stargazers

traal avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.