Skip to content

Instantly share code, notes, and snippets.

@grymmjack
Last active September 15, 2024 04:14
Show Gist options
  • Save grymmjack/7e019b6cf5731b0fd23bd83f021c586c to your computer and use it in GitHub Desktop.
Save grymmjack/7e019b6cf5731b0fd23bd83f021c586c to your computer and use it in GitHub Desktop.
ansifilter can be used to convert ansi to different formats

ansifilter info

original: https://gitlab.com/saalen/ansifilter
my fork: https://gitlab.com/grymmjack/ansifilter

web page: http://andre-simon.de/doku/ansifilter/en/ansifilter.php

needs qt5

sudo apt-get build-dep qtbase5-dev
sudo apt install qtbase5-dev

clone and compile:

git clone https://gitlab.com/saalen/ansifilter.git
cd ansifilter
make
make gui

color map

0 = #000000
1 = #0000aa
2 = #00aa00
3 = #aa5500
4 = #aa0000
5 = #aa00aa
6 = #00aaaa
7 = #aaaaaa
8 = #555555
9 = #ff5555
10 = #55ff55
11 = #55ffff
12 = #5555ff
13 = #ff55ff
14 = #ffff55
15 = #ffffff

Save to ~/Desktop/ansifilter-colormap-cga.txt.ini

usage to convert to html

ansifilter \
  --map ~/Desktop/ansifilter-colormap-cga.txt.ini \
  --art-cp437 \
  --html \
  --input stormtrooper-pixel-art.png-25-NOICE-OPT.ans \
  --output test.html \
  --art-width 82 \
  --art-height 49 \
  --font "Perfect DOS VGA 437 Win" \
  --derived-styles \
  --style ./derived_styles.css

--art-cp437, --art-width, --art-height are all required (sauce has the width/height)

proof it works:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment