Giter Club home page Giter Club logo

sixel.jl's Introduction

Sixel

Julia version Build Status Coverage

Encode the image into a sixel control sequence and vice versa. If your terminal supports this format, then you can get a nice visualization of it.

This package, although itself complete, is probably not the most convinient way to use for normal users. Package authors that aims to support sixel for various image-like types (e.g., image, video, gif, graphic, plot, latex) are the potential targeted users of this package.

The core functionality of this package is supported by the C library libsixel.

Functions

This package exports two functions: sixel_encode and sixel_decode.

  • sixel_encode converts the input array into sixel format sequence.
  • sixel_decode converts the input sixel format sequence into colorant array.

Terminals that support sixel

One important thing about sixel is that not all terminals support sixel control sequence. The following is an incomplete list of terminals that support sixel.

Above these I only manually test iTerm2, mlterm and wezterm.

To run xterm with sixel support, use $ xterm -xrm "XTerm*decTerminalID: vt340" -xrm "XTerm*numColorRegisters: 256".

A demo in iTerm2:

demo

It is the client terminal that renders the image. Hence if you're using any sixel-enabled terminal (e.g., iTerm2) and connect to other servers via ssh, you still get sixel supported. Sixel is nothing special but a string sequence.

Unfortunately, there are some famous widely used advanced terminal/emulator that do not support sixel (yet):

For more information, you can also read the Terminal requirements section in the libsixel repo.

Sixel.jl provides a function to test if your terminal supports it: Sixel.is_sixel_supported(). If your terminal actually supports sixel and it returns false, please open an issue for it.

sixel.jl's People

Contributors

johnnychen94 avatar t-bltg avatar masonprotter avatar timholy avatar github-actions[bot] avatar

Stargazers

Yuchi Yamaguchi avatar  avatar Struan Robertson avatar AbdulazizAhmed avatar Dennis Ogiermann avatar  avatar  avatar Gianni Hong avatar Debarchito Nath avatar  avatar Aarmn the limitless avatar Lasse Peters avatar Ujjwal Panda avatar Suavesito avatar Páll Haraldsson avatar  avatar Curiositas avatar Hai Zhu avatar Lîm Tsú-thuàn avatar Taine Zhao avatar Mauro Risonho de Paula Assumpção avatar Sole avatar Waldir Pimenta avatar  avatar Guillaume Dalle avatar ebigram avatar proteanblank avatar Dream Scatter avatar  avatar Marco M avatar Karthikeyan A K avatar Elias Carvalho avatar JingYu Ning avatar 陳建成(Chien-Cheng (Jeff) Chen) avatar Peter avatar Satoshi Terasaki avatar  avatar  avatar  avatar Cuda Chen avatar

Watchers

 avatar  avatar  avatar

sixel.jl's Issues

tmux master now has sixels

Just wanted to let you know, the README can be updated. There isn't a release of it yet, but you can already build from source.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

support transparent background

From my experiments, it seems that png with transparent background is mapped to non-transparent sixel background.

test

or maybe as an alternative, invert colors, since the following is possible:

$ img2sixel -e -i test.png

windows support

Unfortunately, the cross-compiled libsixel dll library doesn't provide one key symbol that we need: sixel_allocator_new and thus our current implementation doesn't work on Windows. A possible workaround (not yet checked) is to create our Julia version of SixelAllocator and then pass it to the C side libsixel.

@saitoha Is this an expected behavior or I did something wrong with the libsixel compilation? The build script can be found in https://github.com/JuliaPackaging/Yggdrasil/blob/master/L/libsixel/build_tarballs.jl (cross-compiled from mingw)

all exported symbols in windows dll

WechatIMG426
WechatIMG427
WechatIMG428
WechatIMG429

support indexed image and predefined colormap

Currently, every sixel_encode does quantization, dithering, and the real encoding. This could possibly introduce 1) unnecessary computation in quantization and dithering, and 2) unstable colormap generation.

If we consider encoding a video sequence to sixel formats, then we'd like to ensure every frame/slice uses the same quantization and colormap setup.

CRef: FedeClaudi/Term.jl#94 (reply in thread)

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.