• Stars
    star
    608
  • Rank 73,735 (Top 2 %)
  • Language
    HTML
  • License
    GNU General Publi...
  • Created about 9 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Converts jpg images to ASCII

jp2a

jp2a is a simple JPEG to ASCII converter.

The source is available at https://github.com/cslarsen/jp2a. This project used to be hosted on SourceForge.

License

Copyright 2006-2016 Christian Stigen Larsen
Distributed under the GNU General Public License v2.

You can read the full license in the file COPYING. jp2a also uses other libraries. These licenses can be found in the file LICENSES.

Example: Oswald the lucky rabbit

                                                             ......
                                                     .:lOKMMMMMMMMMM0l
                                                .;dOMMMMMMMMMMMMMMMMMMW.
                                            .ckWMMMMMMMMMMMMMMMMMMMMMMMO
                                         .dXMMMMMMMMMMMMMMMMMMMMMMMMMMO
                                      .xWMMMMMMMMMMMMMMMMMMMMMMMMMMO:.
                                    lXMMMMMMMMMMMMMMMMMMMMMWOOxc'
                .;lxOOOOOxdl:.    cMMMMMMMMMMMMMMMMWKklc'..
            'llc..   ..:oMMMMMMKxNMMMMMMMMMM0kl:'.
          :0'             cMMMMMMMMMMMMWd'.
        .K:l0              .MMMMMMMMMMl.
       ,K    W              ,MMMMMMMMMMMMN0dl'
       M.    M               MMMMMMMMMMMMMMMMMMKx:.
      cMMK                   WMMMMMMMMMMMMMMMMMMMMMXd'
      NMMM:                  MMMMMMMMMMMXWMMMMMMMMMMMMNd'
      KMMMW                  MMMMMMMMMMM' ;XMMMMMMMMMMMMMWd'
       MMMM                 XMMMMMMMMMMM    dMMMMMMMMMMMMMMMNc
  ''   NMKWl'             .KMMMMMMMMMMM'     :MMMMMMMMMMMMMMMMMd
 KMWMKOk    '           ,lXMMMMMMMMMMM;       .KMMMMMMMMMMMMMMMM0
 KMMMMM.                    .cOMMMMMW'          kMMMMMMMMMMMMMMMMX
  cOXMNXl.            ......   .MWd. .0cc:'      .NMMMMMMMMMMMMMMMk
        .cololoxKWWWXWMMMMMMM:  M   c:. .l0ok      oMMMMMMMMMMMMMMM
                  .'Mo,MMMMNk:lO' :l  .OMMMMl       .OMMMMMMMMMMMMN
                   X0'OkxkxOK;.  :: ,.XMMMMMMO    :O   lXMMMMMMMMk
                    kc,,o0M0.:;c'N  ko;lMMMMMM:'xMMMNWKO,.clxdl:.
                   ;00xkM:d ,   ..     oMMMMMM cMMMMMMMMl
                   c   N0l       .  .l:;;oKMMk  MMMMMMMMM0
                   O   ,.ocOc..l..k'   .:c;'O   0MMMMMMMX.
                  X     N..l  .c           K.   OMMMMMMM
                 .'     c.     :           M .  OMMM0,.;
                :,   N.;W       ;          O...o .,.
                d    M  ;X'     :l             :
                d..':. lcKol,,,,'.:c,,'.cd;'o,'.
                  . ;:,WMMMMMMXx,; M0XXNNWM.
                       MMMMMMMM   .MMMMMMMM
                       MMMMMMMM   .MMMMMMMM.
                      :ONMMMMMM0:':MMMMMMMMM:
            ;c:,'',::lX'  '',''   .MMMMMMMMMMWK:c:
           x.          .lloc;.',lxl..lKMMMMMKl   M
          0           .;,;'......;::c'  ..     ;dl;l'
         ;O:        .d'              .lkk::::;,     'k
         N.'oc'.    M                   :            X
          lo:. ',::xN:                             .x0'
            .,lccccM .ll,.                . ;;:::;c'.0
                   .kl.  .c::lcccccc:cc::;  .''clccl.
                      'lcl:lc::,,'::cc:cc:c,..

The Oswald character is Copyright Walt Disney, and, unfortunately, not in the public domain. However, I believe that I can use this picture under the fair use clause, for demonstrational purposes, especially in low-resolution, ASCII format. If I am wrong, I will promptly remove it.

Installation

Look in your system's package manager. I don't maintain Windows binaries anymore.

Building

If you want to compile from source, you need autotools and automake. You may need to specify the path to jpeglib. I usually just do

autoreconf -vi
./configure --with-jpeg-prefix=/usr/local \
            --with-curl-config=`which curl-config`
make -j

Before installing, you may want to check that jp2a works by running src/jp2a on some .jpg files. The check target is currently broken, and won't help you. When you're ready to install,

make -j install

jp2a depends on jpeglib. In case configure fails beacuse jpeglib is not installed, it can be built and installed manually. Independent JPEG Group provides a UNIX format package in tar.gz format which can be downloaded from http://www.ijg.org/.

Extract the archive and follow the instructions inside 'install.txt' to build and install it. For a default install, the corresponding .so (shared object) files will be present in /usr/local/lib/

Next, run the command ldconfig (escalated privileges may be required) to configure dynamic linker run-time bindings. See its man page for more details. The configure command should work after that.

If configure can't automatically find jpeglib, specify with

./configure --with-jpeg-include=PATH --with-jpeg-lib=PATH

or you can just type the prefix

./configure --with-jpeg-prefix=/usr/local/

You can also compile jp2a with libcurl, so it can automatically download images from the net:

./configure --enable-curl

This will look for curl-config in $PATH, but you can specify it directly with --with-curl-config=PATH if you need to.

Windows

You need a working jpeglib for Windows and set up include paths yourself. You will need to manually type out a config.h file. Example:

WIN32
NDEBUG
_CONSOLE
PACKAGE_STRING=\"jp2a x.x.x-win32\"
PACKAGE_BUGREPORT=\"[email protected]\"
HAVE_STRING_H
HAVE_STDLIB_H
FEAT_CURL
HAVE_CURL_CURL_H
CURL_STATICLIB
FEAT_TERMLIB

You need to add jpeg.lib to the linker. If you want libcurl support, you need that as well. It should be available from http://curl.haxx.se

More Repositories

1

mandelbrot-js

Fast rendering of the Mandelbrot set in HTML5 canvas using JavaScript
JavaScript
344
star
2

wpm

Typeracer-like console app for measuring your WPM
Python
318
star
3

minijit

A basic x86-64 JIT compiler written from scratch in stock Python
Python
210
star
4

stack-machine

A simple stack-based virtual machine in C++ with a Forth like programming language
C++
162
star
5

python-simple-vm

A simple virtual machine w/constant folding implemented in Python
Python
117
star
6

arv

A fast 23andMe DNA parser and inferrer for Python
C++
114
star
7

mersenne-twister

This Mersenne Twister is a fast pseudo-random number generator (PRNG) in C++
C++
83
star
8

dna-traits

A fast 23andMe genome text file parser, now superseded by arv
Python
65
star
9

mickey-scheme

Mickey Scheme is an interpreter for R7RS Scheme written in pure C++
C++
62
star
10

crianza

A stack machine VM, interpreter and genetic programming library
Python
47
star
11

miller-rabin

The Miller-Rabin probabilistic primality test in C++ w/GMP
C++
30
star
12

libunwind-examples

A few libunwind examples
C++
27
star
13

lua-cpp

Tutorial code for Lua and C++ integration
C++
20
star
14

luajit-cpp

Example C++ shared library loaded in LuaJIT through FFI
C++
19
star
15

brainfuck-jit

Brainfuck JIT VMs
Python
17
star
16

c64-examples

Simple C64 programs compiled from the command line
Assembly
15
star
17

lyn

Python bindings for GNU Lightning
Python
9
star
18

vimp

Command line plugin manager for vim
Python
8
star
19

busy-beaver

Calculates the uncomputable Busy Beaver Σ-function
Python
7
star
20

gameboy

A Gameboy emulator in Python
Python
7
star
21

eulers-totient-function

A fast implementation of Euler's totient function phi(n) in C++
C++
7
star
22

skall

SKALL is a minimal, experimental UNIX shell
C
6
star
23

cellular-automaton

Cellular automaton using the HTML5 canvas.
6
star
24

nash-cipher

John Nash's encryption scheme from his 1955 letter to the NSA in C++.
C++
5
star
25

chicken-play

Chicken Scheme HTML5 rendering library
Scheme
3
star
26

poseur

Simple presentation tool
Python
3
star
27

vev

Simple HTTP server request routing in Python
Python
3
star
28

mickey-scheme-historic

Mickey Scheme is an interpreter for R7RS Scheme written in C++
C++
3
star
29

rosalind

Solutions to the Rosalind.info puzzles
C++
2
star
30

impute-me

This is the code behind the www.impute.me site. It contains algorithms for imputing personal genomes, as well as a range of custom-made analysis for genetics-based disease and health.
R
2
star
31

elv

Parses bank CSV files
Python
1
star
32

q

Prints C/C++ definitions from current directory
Python
1
star
33

latex-template

A small LaTeX template to get you started
TeX
1
star
34

presentation-vm

The presentation "How to make a simple virtual machine"
Brainfuck
1
star
35

project-euler

My Project Euler solutions
C++
1
star
36

dotfiles

Collection of my personal dot-files
Shell
1
star
37

armstrong-notes

Notes for M.A. Armstrong's Groups and Symmetry
TeX
1
star
38

py-html-generator

A quick-and-dirty HTML document generator and renderer
Python
1
star
39

callcc-c

Experimental undelimited continuations in C via x86-64 assembly
C
1
star