IMG2SIXEL(1)
π IMG2SIXEL(1) β General Commands Manual, but make it cute π
okay bestie, gather round π«Ά you just opened img2sixel(1), the group chat where your random lil images get turned into gorgeous DEC SIXEL graphics. no cap, this is the good stuff. let's go β¨
πΈ NAME πΈ
img2sixel β image converter to DEC SIXEL graphics. that's it, that's the whole vibe π
π SYNOPSIS π
img2sixel [ -options ] imagefiles
img2sixel [ -options ] < imagefiles
π DESCRIPTION π
img2sixel converts various images into high quality DEC SIXEL image format. iconic behavior, honestly π
β¨ COMMAND-LINE OPTIONS β¨
img2sixel has the following command-line options, and yes, we're going through all of them, no skipping π§
-o,--outfileβ specify output file name (default:stdout). so if you don't say anything, it just yells into your terminal, main character energy π-7,--7bit-modeβ generate a sixel image for 7bit terminals or printers (this is the default, she's the moment).-8,--8bit-modeβ generate a sixel image for 8bit terminals or printers.-R,--gri-limitβ limit arguments of DECGRI('!') to 255.-p COLORS,--colors=COLORSβ specify number of colors to reduce the image to (default=256).-m FILE,--mapfile=FILEβ transform image colors to match this set of colors (the og manpage has a lil typo here and says "colorsspecify map", but you get it π specify the map, bestie).-e,--monochromeβ output monochrome sixel image. this option assumes the terminal background color is black.-k,--insecureβ allow to connect to SSL sites without certs (enabled only when configured with--with-libcurl). bestie this is the "we're going in without a helmet" flag π-i,--invertβ assume the terminal background color is white. make sense only when-eoption is given.-I,--high-colorβ output 15bpp sixel image. she's fancy π-u,--use-macroβ use DECDMAC and DEVINVM sequences to optimize GIF animation rendering.-n MACRONO,--macro-number=MACRONOβ specify an number argument for DECDMAC and make terminal memorize SIXEL image. No image is shown if this option is specified π (yes, it just memorizes, it does NOT show you anything).-C COMPLEXIONSCORE,--complexion-score=COMPLEXIONSCOREβ specify an number argument for the score of complexion correction.COMPLEXIONSCOREmust be1or more.-g,--ignore-delayβ render GIF animation without delay. zero patience, we love that.-S,--staticβ render animated GIF as a static image.-d DIFFUSIONTYPE,--diffusion=DIFFUSIONTYPEβ choose diffusion method which used with color reduction.DIFFUSIONTYPEis one of them:autoβ choose diffusion type automatically (default)noneβ do not diffusefsβ Floyd-Steinberg methodatkinsonβ Bill Atkinson's methodjajuniβ Jarvis, Judice & Ninkestuckiβ Stucki's methodburkesβ Burkes' methoda_ditherβ positionally stable arithmetic ditherx_ditherβ positionally stable arithmetic xor based dither
-f FINDTYPE,--find-largest=FINDTYPEβ choose method for finding the largest dimension of median cut boxes for splitting, make sense only when-poption (color reduction) is specified.FINDTYPEis one of them:autoβ choose finding method automatically (default)normβ simply comparing the range in RGB spacelumβ transforming into luminosities before the comparison
-s SELECTTYPE,--select-color=SELECTTYPEβ choose the method for selecting representative color from each median-cut box, make sense only when-poption (color reduction) is specified.SELECTTYPEis one of them:autoβ choose selecting method automatically (default)centerβ choose the center of the boxaverageβ calculate the color average into the boxhistogramβ similar with average but considers color histogram
-c REGION,--crop=REGIONβ crop source image to fit the specified geometry.REGIONshould be formatted as'%dx%d+%d+%d'.-w WIDTH,--width=WIDTHβ resize image to specified width.WIDTHis represented by the following syntax:autoβ preserving aspect ratio (default)<number>%β scale width with given percentage<number>β scale width with pixel counts<number>pxβ scale width with pixel counts
-h HEIGHT,--height=HEIGHTβ resize image to specified height.HEIGHTis represented by the following syntax:autoβ preserving aspect ratio (default)<number>%β scale height with given percentage<number>β scale height with pixel counts<number>pxβ scale height with pixel counts
-r RESAMPLINGTYPE,--resampling=RESAMPLINGTYPEβ choose resampling method used with-wor-hoption (scaling).RESAMPLINGTYPEis one of them:nearestβ Nearest-Neighbor methodgaussianβ Gaussian filterhanningβ Hanning filterhammingβ Hamming filterbilinearβ Bilinear filter (default)welshβ Welsh filterbicubicβ Bicubic filterlanczos2β Lanczos-2 filterlanczos3β Lanczos-3 filterlanczos4β Lanczos-4 filter
-q QUALITYMODE,--quality=QUALITYMODEβ select quality of color quanlization.QUALITYMODEis one of them:autoβ decide quality mode automatically (default)highβ high quality and low speed modelowβ low quality and high speed modefullβ quality and careful speed mode
-l LOOPMODE,--loop-control=LOOPMODEβ select loop control mode for GIF animation.autoβ honer the setting of GIF header (default)forceβ always enable loopdisableβ always disable loop
-t PALETTETYPE,--palette-type=PALETTETYPEβ select palette color space type.autoβ choose palette type automatically (default)hlsβ use HLS color spacergbβ use RGB color space
-b BUILTINPALETTE,--builtin-palette=BUILTINPALETTEβ select built-in palette typexterm16β X default 16 color mapxterm256β X default 256 color mapvt340monoβ VT340 monochrome mapvt340colorβ VT340 color map
-E ENCODEPOLICY,--encode-policy=ENCODEPOLICYβ select encoding policyautoβ choose encoding policy automatically (default)fastβ encode as fast as possiblesizeβ encode to as small sixel sequence as possible
-B BGCOLOR,--bgcolor=BGCOLORβ specify background color.BGCOLORis represented by the following syntax:#rgb#rrggbb#rrrgggbbb#rrrrggggbbbbrgb:r/g/brgb:rr/gg/bbrgb:rrr/ggg/bbbrgb:rrrr/gggg/bbbb
-P,--penetrateβ penetrate GNU Screen using DCS pass-through sequence.-D,--pipe-modeβ [[deprecated]] read source images fromstdincontinuously. > she's deprecated bestie, still here, still works, but the manpage literally brackets it in[[deprecated]]so mind that π-v,--verboseβ show debugging info.-V,--versionβ show version and license info.-H,--helpβ print help.
πΏ ENVIRONMENT VARIABLES πΏ
ok so the manpage literally says "img2sixel has the following command-line options:" right here in the environment variables section π that's a typo moment, these are env vars, but we're keeping the info exactly. img2sixel has the following:
SIXEL_BGCOLORβ specify background color. overrided by-B(--bgcolor) option. represented by the following syntax:#rgb#rrggbb#rrrgggbbb#rrrrggggbbbbrgb:r/g/brgb:rr/gg/bbrgb:rrr/ggg/bbbrgb:rrrr/gggg/bbbb
SIXEL_NCOLORSβ specify number of colors to reduce the image to (default=256). overrided by-p(--colors) option.
πΌοΈ Image loaders πΌοΈ
img2sixel includes two or more image decoder components. the roster is stacked, fr fr π₯
stb_image
libsixel includes stb_image, a public domain image loader. img2sixel uses it as the default built-in image decoder. It can decode almost all images. but a few images can not be decoded by its limitations π
Supported source formats:
- JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib)
- PNG 1/2/4/8/16-bit-per-channel
- TGA (not sure what subset, if a subset)
- BMP non-1bpp, non-RLE
- PSD (composited view only, no extra channels)
- PIC (Softimage PIC)
- PNM (PPM and PGM binary only)
Limitations:
- no 12-bit-per-channel JPEG
- no JPEGs with arithmetic coding / JPEG 2000
- no 1-bit BMP
libpng
If libpng library is linked at compile time, img2sixel uses it for decoding PNG image. β¨
libjpeg
If libjpeg library is linked at compile time, img2sixel uses it for decoding JPEG image. β¨
gdk-pixbuf2
If gdk-pixbuf2 library is linked at compile time, img2sixel uses it automatically in some cases.
GD
If GD library is linked at compile time, img2sixel uses it automatically in some cases.
libsixel
img2sixel can load SIXEL as source image format, because it uses libsixel as a SIXEL image decoder. she contains multitudes π
π HISTORY π
Former SIXEL encoders (such as ppmtosixel) are mainly designed for dot-matrix printers. They minimize the amount of printer-head movement distance. But nowadays this method did not represent the best performance for displaying sixel data on terminal emulators. Encoded SIXEL data for VT-2xx/VT-3xx terminals were found in 80's Usenet, But the technology of how to create them seems to be lost. gone, reduced to atoms π
kmiya's sixel(kmiya,2014) introduces an efficient encoding method which is re-designed for terminal emulators to optimize the overhead of transporting SIXEL with keeping compatibility with former SIXEL terminal. Now libsixel and ImageMagick's sixel coder follow it. king behavior π
Araki Ken, known as the maintainer of mlterm, proposed the method for more compressed SIXEL encoding. Now libsixel adopted that method. Araki Ken describes about the way to generate high quality SIXEL.
See http://mlterm.sourceforge.net/libsixel.pdf (in Japanese).
π SEE ALSO π
sixel(5) sixel2png(1)
π«Ά AUTHORS π«Ά
img2sixel is maintained by Hayaki Saito. We imported whole code of stb_image v2.12, written by Sean Barrett and its contributers, for loading various images, and imported some code from pnmquant.c (netpbm library) for image quantization. credit where credit is due, periodt π
π COPYRIGHT π
Okay bestie, legal time, but make it cute. π
Copyright (c) 2014-2016 Hayaki Saito
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Likeβ¦ it's free, it's chill, just don't sue anyone and keep the notice. That's the vibe. β¨
π«Ά THANKS π«Ά
This software derives from the following implementations. Not me being dramatic, this is literally where it comes from. π
stb_image-v2.12β This software includesstb_image-v2.12(stb_image.h), a public domain JPEG/PNG reader. Iconic. No notes.https://github.com/nothings/stbpnmquant.c(netpbm library) β The implementation of median cut algorithm for color quantization inquant.cis imported frompnmcolormapincluded in netpbm library.http://netpbm.sourceforge.net/β andpnmcolormapwas derived fromppmquant, originally by Jef Poskanzer.
Copyright (C) 1989, 1991 by Jef Poskanzer.
Copyright (C) 2001 by Bryan Henderson.
Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without express or implied warranty.
sixel 2014-3-2β some part ofconverters/loader.care derived from kmiya's "sixel" original version (2014-3-2).http://nanno.dip.jp/softlib/man/rlogin/sixel.tar.gzβ It is written bykmiya@culti. He distributes it under very permissive license which permits useing, copying, modification, redistribution, and all other public activities without any restrictions. He declares this is compatible with MIT/BSD/GPL.
ngl "useing" is spelled like that in the original and I am not about to touch it, that's the manpage's whole brand now. π
π REFERENCES π
resize.c(ImageMagick) β We added some resampling filters in reference to the line-up of filters of MagickCore'sresize.c.http://www.imagemagick.org/api/MagickCore/resize_8c_source.html
π CONTRIBUTORS π
The absolute icons who made this happen, roll call besties: π
- Araki Ken (
@arakiken) - Markus Elfring (
@elfring) - Akinori Hattori (
@hattya) - isaki (
@isaki68k) - NOKUBI Takatsugu (
@knok) - Yasuhiro MATSUMOTO (
@mattn) - Masami HIRATA(
@msmhrt) - OBATA Akio (
@obache) - Izumi Tsutsui (
@tsutsui) - Iwamoto Kouichi (
@ttdoda) - haru (
@uobikiemukot) - Vertis Sidus (
@vrtsds) - Bruce Mitchener (
@waywardmonkeys) - Kazuhiro YOSHIKAWA (
@yoshikaw) - Turenar <sora@turenar.xyz>
- Yusuke Endoh <mame@ruby-lang.org>
- mattn <mattn.jp@gmail.com>
- Akinori Hattori <hattya@gentoo.org>
- Γyvind KolΓ₯s <pippin@gimp.org>
- Henri Salo (
@fgeek) - hongxu (
@HongxuChen) - pwd (
@YourButterfly) - Nicholas Luedtke (
@nluedtke) - cool-tomato (
@cool-tomato)
Every single one of them ate and left no crumbs. π
π BUGS π
- Send bug-reports, fixes, enhancements to
saitoha@me.com
Found something cursed? Spill it to the email above, bestie, they actually want to know. π
And that's a wrap on IMG2SIXEL(1) from the 4th Berkeley Distribution, dated Aug 2016 β¨ β go forth and make your terminal gorgeous, you got this fr fr. πππ¦
π¦ where this page comes from
- alpine 3.24: libsixel-doc 1.10.5-r0 Β· MIT
- arch rolling: libsixel 1.10.5-1 Β· MIT
- debian bookworm: libsixel-bin 1.10.3-3 Β· MIT
- debian trixie: libsixel-bin 1.10.5-1 Β· MIT
- fedora 43: libsixel-utils 1.10.5-4.fc43 Β· MIT
- fedora 43: libsixel-utils 1.10.5-5.fc43 Β· MIT
- fedora 44: libsixel-utils 1.10.5-6.fc44 Β· MIT
- nixos 26.05: libsixel 1.10.5
- nixpkgs unstable: libsixel 1.10.5
- opensuse-leap 16.0: libsixel-utils 1.10.3-bp160.1.13 Β· MIT
- opensuse-leap 16.0: libsixel-utils 1.10.3-bp160.1.13 Β· MIT
- opensuse-leap 16.0: libsixel-utils 1.10.3-bp160.1.13 Β· MIT
- opensuse-leap 16.0: libsixel-utils 1.10.3-bp160.1.13 Β· MIT
- ubuntu jammy: libsixel-bin 1.10.3-3 Β· MIT
- ubuntu noble: libsixel-bin 1.10.3-3build1 Β· MIT
- ubuntu questing: libsixel-bin 1.10.5-1
- ubuntu resolute: libsixel-bin 1.10.5-1build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms