ascii-image-converter is a command-line tool that converts images into
ascii art and prints them out onto the console. Available on Windows,
Linux and macOS.
Links:
ascii-image-converter.SlackBuild
[code]
#!/bin/bash # Slackware build script for ascii-image-converter # Copyright 2023 JW(Shinichi Abe) <shin1.abe@nifty.com> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=ascii-image-converter VERSION=${VERSION:-1.13.1} BUILD=${BUILD:-1} TAG=${TAG:-jw} PKGTYPE=${PKGTYPE:-txz} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 fi TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ -o -perm 511 \) -exec chmod 755 {} \; -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ # Compile the application and install it into the $PKG directory go build -v -o $PRGNAM # Install binary install -Dm755 $PRGNAM -t "$PKG/usr/bin/" # Install example gifs mkdir -p $PKG/usr/share/$PRGNAM cp -a $CWD/cli-usage.txt example_gifs $PKG/usr/share/$PRGNAM # Don't ship .la files: rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true #find $PKG/usr/man -type f -exec gzip -9 {} \; #for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done find $PKG -name perllocal.pod \ -o -name ".packlist" \ -o -name "*.bs" \ | xargs rm -f mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a LICENSE.txt README.md $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild cat $CWD/cli-usage.txt > $PKG/usr/doc/$PRGNAM-$VERSION/cli-usage.txt # Copy the slack-desc (and a custom doinst.sh if necessary) into ./install mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |
slack-desc
[code]
# HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. # Line up the first '|' above the ':' following the base package name, and # the '|' on the right side marks the last column you can put a character in. # You must make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':' except on otherwise blank lines. |-----handy-ruler------------------------------------------------------| ascii-image-converter: ascii-image-converter (converts images into ascii art) ascii-image-converter: ascii-image-converter: ascii-image-converter is a command-line tool that converts images ascii-image-converter: into ascii art and prints them out onto the console. ascii-image-converter: ascii-image-converter: HOME: https://github.com/TheZoraiz/ascii-image-converter ascii-image-converter: ascii-image-converter: ascii-image-converter: ascii-image-converter: ascii-image-converter: |
Usage : ascii-image-converter --help
[code]
This tool converts images into ascii art and prints them on the terminal. Further configuration can be managed with flags. Usage: ascii-image-converter [image paths/urls or piped stdin] [flags] Flags: -C, --color Display ascii art with original colors If 24-bit colors aren't supported, uses 8-bit (Inverts with --negative flag) (Overrides --grayscale and --font-color flags) --color-bg If some color flag is passed, use that color on character background instead of foreground (Inverts with --negative flag) (Only applicable for terminal display) -d, --dimensions ints Set width and height for ascii art in CHARACTER length e.g. -d 60,30 (defaults to terminal height) (Overrides --width and --height flags) -W, --width int Set width for ascii art in CHARACTER length Height is kept to aspect ratio e.g. -W 60 -H, --height int Set height for ascii art in CHARACTER length Width is kept to aspect ratio e.g. -H 60 -m, --map string Give custom ascii characters to map against Ordered from darkest to lightest e.g. -m " .-+#@" (Quotation marks excluded from map) (Overrides --complex flag) -b, --braille Use braille characters instead of ascii Terminal must support braille patterns properly (Overrides --complex and --map flags) --threshold int Threshold for braille art Value between 0-255 is accepted e.g. --threshold 170 (Defaults to 128) --dither Apply dithering on image for braille art conversion (Only applicable with --braille flag) (Negates --threshold flag) -g, --grayscale Display grayscale ascii art (Inverts with --negative flag) (Overrides --font-color flag) -c, --complex Display ascii characters in a larger range May result in higher quality -f, --full Use largest dimensions for ascii art that fill the terminal width (Overrides --dimensions, --width and --height flags) -n, --negative Display ascii art in negative colors -x, --flipX Flip ascii art horizontally -y, --flipY Flip ascii art vertically -s, --save-img string Save ascii art as a .png file Format: <image-name>-ascii-art.png Image will be saved in passed path (pass . for current directory) --save-txt string Save ascii art as a .txt file Format: <image-name>-ascii-art.txt File will be saved in passed path (pass . for current directory) --save-gif string If input is a gif, save it as a .gif file Format: <gif-name>-ascii-art.gif Gif will be saved in passed path (pass . for current directory) --save-bg ints Set background color for --save-img and --save-gif flags Pass an RGBA value e.g. --save-bg 255,255,255,100 (Defaults to 0,0,0,100) --font string Set font for --save-img and --save-gif flags Pass file path to font .ttf file e.g. --font ./RobotoMono-Regular.ttf (Defaults to Hack-Regular for ascii and DejaVuSans-Oblique for braille) --font-color ints Set font color for terminal as well as --save-img and --save-gif flags Pass an RGB value e.g. --font-color 0,0,0 (Defaults to 255,255,255) --only-save Don't print ascii art on terminal if some saving flag is passed --formats Display supported input formats -h, --help Help for ascii-image-converter -v, --version Version for ascii-image-converter Copyright © 2021 Zoraiz Hassan <hzoraiz8@gmail.com> Distributed under the Apache License Version 2.0 (Apache-2.0) For further details, visit https://github.com/TheZoraiz/ascii-image-converter |
引き続き更新予定