You are not logged in.

#1 2006-09-22 06:33:37

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

looking for ascii art wizards

I'd like to humbly request someone with the skills or someone who knows the right tools, to take the two images in the upper left (the "arch" and the archlinux word) and convert them to ascii art.

Now, I do not mean a simple "convert logo.png logo.xpm", that'd be too easy.  I'm looking for:

a) terminal escapes for colors
b) sized to fit on a 80x30 screen or so.

This implies that it should be in a text file, and, on a color terminal, if I "cat archlogo", it should look as intended.

That makes the "arch" a bit wonky, but still doable... here's an example:

debainexamplevi2.png

If anyone can do this, I'd be in your debt forever. Also, if you know any tools to use to do something like this, let me know as well.

Offline

#2 2006-09-22 06:40:17

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: looking for ascii art wizards

#!/bin/bash
#
# $ Id: image2ascii,v 1.6 2002/12/01 12:36:56 roland Exp roland $
#
# Convert any image to an ASCII-graphic using ImageMagick
#
##########################################################################
#
#   Copyright (C) 1997-2002  Roland Rosenfeld <roland>
#
#   This program is free software; you can redistribute it and/or
#   modify it under the terms of the GNU General Public License as
#   published by the Free Software Foundation; either version 2 of
#   the License, or (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
#   General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
##########################################################################

CONVERT=convert        # The ImageMagick convert binary
PBMTOASCII=pbmtoascii    # The NetPBM pbmtoascii binary

umask 077

tmpdir=${TMPDIR-/tmp}/image2ascii.$$
mkdir $tmpdir || exit 1
trap "rm -rf $tmpdir; exit" 0 1 2 3 15

TMPFILE=$tmpdir/image

usage="Usage: $0 [option] [imagefile]

   -help                display this help text
   -geometry 132x50     define the size of the ascii image"


# set default geometry to display width:
geometry=`stty size </dev> $TMPFILE ;;
        1 ) case "$1" in
                    -* ) echo "$usage"; exit 0 ;;
                    * )  cat "$1" > $TMPFILE ;;
            esac ;;
        2 ) case "$1" in
                    -geometry ) geometry=$2
                                cat > $TMPFILE ;;
                    * )         echo "$usage"; exit 0 ;;
            esac ;;
        3 ) case "$1" in
                    -geometry ) geometry=$2
                                cat $3 > $TMPFILE ;;
                    * )         echo "$usage"; exit 0 ;;
            esac ;;
        * ) echo "$usage"; exit 0 ;;
esac

# multiply x with 2 and y with 4 (pbmtoascii divides by 2x4)
geometry=`echo $geometry | awk -Fx '{print 2*$1 "x" 4*$2}'`

$CONVERT -geometry $geometry $TMPFILE $TMPFILE.pbm
$PBMTOASCII -2x4 < $TMPFILE.pbm

Offline

#3 2006-09-22 06:52:42

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: looking for ascii art wizards

Real close, but it doesn't do color 8(

Offline

#4 2006-09-22 07:33:59

smoon
Member
Registered: 2005-08-22
Posts: 468
Website

Re: looking for ascii art wizards

I think the easiest way would be using libcaca. Unfortunately I'm unable to find a simple converter that converts an image to ascii using libcaca. But using Perl or something it shouldn't be too hard to hack something together quickly: http://search.cpan.org/~iamcal/Image-Ca … age/Caa.pm

Offline

#5 2006-09-22 13:29:28

TomE
Member
Registered: 2005-08-06
Posts: 164

Re: looking for ascii art wizards

#!/bin/bash
echo ""$'e[0;34m'"
              _
          _=(SDGJT=_
        _GTDJHGGFCVS)
       ,GTDJGGDTDFBGX0
      JDJDIJHRORVFSBSVL"$'e[0;30m'"-=+=,_"$'e[0;34m'"
     IJFDUFHJNXIXCDXDSV,"$'e[0;30m'"  "DEBL"$'e[0;34m'" 
    |LKDSDJTDU=OUSCSBFLD."$'e[0;30m'"   '?ZWX,"$'e[0;34m'"
    LMDSDSWH='   `?DCBOSI"$'e[0;30m'"   DRDS],"$'e[0;34m'"
   SDDFDFH'        `0YEWD,"$'e[0;30m'"   )HDROD"$'e[0;34m'"
  !KMDOCG           '&GSU|"$'e[0;30m'"_GFHRGO'"$'e[0;34m'"
  HKLSGP'           "$'e[0;30m'"__"$'e[0;34m'"TKM0,"$'e[0;30m'"GHRBV)'"$'e[0;34m'"
 JSNRVW'       "$'e[0;30m'"__+MNAEC"$'e[0;34m'"IOI!"$'e[0;30m'"BN'"$'e[0;34m'"
 HELK['  "$'e[0;30m'"  __,=OFFXCBGHC"$'e[0;34m'"FD)
JKGHEH"$'e[0;30m'"_-#DASDFSLSV='"$'e[0;34m'"    'EF
!EHTI"$'e[0;30m'" '`^'`"$'e[0;34m'"              !H
 `0F'                    '|
"

Offline

#6 2006-09-22 15:11:44

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: looking for ascii art wizards

TomE, how'd you generate that? It works nice, exvept the black background arch is, well, black.  It doesn't show up too well

Offline

#7 2006-09-22 15:47:20

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: looking for ascii art wizards

This was posted in the screenshot thread a couple of months ago.

33[0;36m                   oOOOOOOo
33[0;36m                oOOOOOOOOOOOOo
33[0;36m              oOOOOOOOOOOOOOOOOo
33[0;36m             OOOOOOOOOOOOOOOOOOOO
33[0;36m            OOOOOOOOOOOOOOOOOOOOOO 33[1;30mOOOo
33[0;36m           OOOOOOOOOOOOOOOOOOOOOOOO  33[1;30m°OOOOo
33[0;36m          OOOOOOOOO°         °OOOOOO   33[1;30mOOOOOO
33[0;36m         OOOOOOOO°             °OOOOO   33[1;30mOOOOOO
33[0;36m        oOOOOOOO                 °OOOO 33[1;30mOOOOOO
33[0;36m        OOOOOOO                   °OO33[1;30mOOOOOO°
33[0;36m       oOOOOOO                  33[1;30mooOOOOOO°
33[0;36m       OOOOOO              33[1;30mooOOOOOOO 33[0;36mOOo
33[0;36m       OOOOOO        33[1;30moooOOOOOO°°     33[0;36m°OO
33[0;36m       OOOOO 33[1;30moooOOOOO°°°              33[0;36m°O
33[0;36m       °OO°                            33[0;36mO
33[0m

EDIT: There is an online image-to-text converter at http://www.text-image.com/convert/. For the text, you could use the ASCII generator. There is a gazillion of fonts to select from.

                _     _ _                  
               | |   | (_)                 
  __ _ _ __ ___| |__ | |_ _ __  _   ___  __
 / _` | '__/ __| '_ | | | '_ | | |  / /
| (_| | | | (__| | | | | | | | | |_| |>  < 
 __,_|_|  ___|_| |_|_|_|_| |_|__,_/_/_

Offline

#8 2006-09-22 19:27:18

TomE
Member
Registered: 2005-08-06
Posts: 164

Re: looking for ascii art wizards

phrakture wrote:

TomE, how'd you generate that? It works nice, exvept the black background arch is, well, black.  It doesn't show up too well

vim  tongue it was  part of a bash script that I was making to show some info for screen shots but I got bored and did not finish it.
200609222010121152x864scrotjb7.th.png
Looks like this if your interested

You could have a look at jp2a in aur but if I rember right its just for viewing and does not give any output.

Offline

#9 2006-09-22 20:25:22

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: looking for ascii art wizards

With some minor edits, using TomE's and __sh's solutions:

archbannerzt3.th.png
Yeah, it has a white BG arch, no biggie.  The only other option is to make the border chars white and the others black...

Also note, TomE, you can get rid of the $"" around the escapes by using "echo -e"

Edit re-uploaded image... imageshack seems to hate me.

Offline

#10 2006-09-22 20:27:05

dadexter
Member
From: Dorval, QC, Canada
Registered: 2004-09-07
Posts: 274
Website

Re: looking for ascii art wizards

A

Archlinux

(I suck)

Offline

#11 2006-10-10 12:15:31

Sigi
Member
From: Thurgau, Switzerland
Registered: 2005-09-22
Posts: 1,131

Re: looking for ascii art wizards

TomE wrote:

You could have a look at jp2a in aur but if I rember right its just for viewing and does not give any output.

I'm a little late, but:
What's the problem with jp2a? It converts jpeg and outputs it as ascii code. Isn't this what you where looking for?

I'm not at my machine right now, but try it out:

convert http://bbs.archlinux.org/templates/subSilver/images/logo_phpBB.gif jpg:- | jp2a -

Haven't been here in a while. Still rocking Arch. smile

Offline

#12 2006-11-11 20:34:35

meow
Member
Registered: 2006-07-31
Posts: 7

Re: looking for ascii art wizards

By the way, this just happens to be the beginning of my rc.sysinit:

#!/bin/sh
#
# /etc/rc.sysinit
#

. /etc/rc.conf
. /etc/rc.d/functions

clear
echo -e "$C_OTHER                   __"
echo -e "$C_OTHER ___ __ __ __ ____|  |___  $C_MAIN Arch Linux v0.7.2 (${C_H2}Gimmick$C_MAIN)"
echo -e "$C_OTHER| __'  |  '__| ___|  '   | $C_MAIN (C)2002-2006 Judd Vinet"
echo -e "$C_OTHER|___,__|__|  |____|__||__| $C_MAIN Distributed under the GNU GPL"
echo -e "$C_SEPARATOR ------------------------  $C_MAIN http://archlinux.org"
echo -e "$C_CLEAR"

...

Offline

#13 2006-11-11 21:10:48

McQueen
Member
From: Arizona
Registered: 2006-03-20
Posts: 387

Re: looking for ascii art wizards

I like to have an Arch logo entry visible with each terminal session so I use a script in /etc/rc.d that is run at desktop login and thereafter as a cronjob (to increment the uptime variable) which outputs to the text file /etc/issue. This is then read by my ~/.bashrc via the simple entry below. I then add a few more things to .bashrc to provide further output but the ascii logo and system info gets it started.

# Import Issue
echo
cat /etc/issue
echo

This is the /etc/rc.d script:

#! /bin/bash

LGRAY="33[1;6m33[1;37m"
WHITE="33[1;6m33[1;37m"
LBLUE="[1;36m"
DBLUE="[0;36m"
DGREY="[1;30m"

UPTIME=`uptime | awk '{for ( i = 3; i <= NF-7; i++ ) if ( i != NF-7 ) 
print $i; else print substr($i,1,length($i)-1);}'`

rm -f /etc/issue
/usr/bin/clear >> /etc/issue

echo -e $WHITE'                     oooo                 '$LGRAY'Hostname: '$(hostname)    >> /etc/issue
echo -e $WHITE'                  oOOOOOOOOo              '$LGRAY'Kernel:   '$(uname -r)       >> /etc/issue
echo -e $WHITE'                oOOOOOOOOOOOOo            '$LGRAY'Uptime:   '$UPTIME           >> /etc/issue
echo -e $LBLUE'              oOOOOOOOOOOOOOOOOo          '$WHITE'Arch Linux 0.7.2 (Gimmick)  ' >> /etc/issue
echo -e $LBLUE'             OOOOOOOOOOOOOOOOOOOO                                            ' >> /etc/issue
echo -e $DBLUE'            OOOOOOOOOOOOOOOOOOOOOO'$DGREY' OOOo                              ' >> /etc/issue
echo -e $DBLUE'           OOOOOOOOOOOOOOOOOOOOOOOO  '$DGREY'OOOOo                           ' >> /etc/issue
echo -e $DBLUE'          OOOOOOOOO         OOOOOO   '$DGREY'OOOOOO                          ' >> /etc/issue
echo -e $DBLUE'         OOOOOOOO             OOOOO   '$DGREY'OOOOOO                         ' >> /etc/issue
echo -e $LBLUE'        oOOOOOOO                 OOOO '$DGREY'OOOOOO                         ' >> /etc/issue
echo -e $LBLUE'        OOOOOOO                   OO'$DGREY'OOOOOO                           ' >> /etc/issue
echo -e $LBLUE'       oOOOOOO                  '$DGREY'ooOOOOOO                             ' >> /etc/issue
echo -e $LBLUE'       OOOOOO              '$DGREY'ooOOOOOOO' $LBLUE'OOO                     ' >> /etc/issue
echo -e $LBLUE'       OOOOOO        '$DGREY'oooOOOOOO     '$LBLUE'OO                        ' >> /etc/issue
echo -e $LBLUE'       OOOOO '$DGREY'oooOOOOO              '$LBLUE'O                         ' >> /etc/issue
echo -e $LBLUE'       OO                           '$LBLUE'O                                ' >> /etc/issue
echo -e $LBLUE'                                                                             ' >> /etc/issue
echo -e $LGRAY"n$(date)" >> /etc/issue
cp -f /etc/issue /etc/issue.net

/path/to/Truth

Offline

Board footer

Powered by FluxBB