Jump to content
You must now use your email address to sign in [click for more info] ×

Recommended Posts

43 minutes ago, walt.farrell said:

On the other hand, couldn't you draw a vector shape (such as an apple shape), get it looking like you want, and click on it with the Frame Text Tool to give you Shape Text?

That's what ASCII-Converters usually in a programmed fashion do, aka converting some shape/form/image into an ascii-text representation.

However there are hundreds of such ascii-tools available and not only ascii-converters, a bunch of them are free form ascii-editors for creating text, shapes, diagramms, boxes, etc.

Just a few (a small selection) from the available ascii/ansi-editors here ...

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

26 minutes ago, walt.farrell said:

On the other hand, couldn't you draw a vector shape (such as an apple shape), get it looking like you want, and click on it with the Frame Text Tool to give you Shape Text? Then fill it it with the appropriate characters. You could insert zero-width spaces to break lines of text. And you might need to adjust the shape a bit to account for the indents that will be applied automatically.

That is what I was trying to do using only AD, but like I thought I made clear, it still requires manually adding line breaks & lots of tweaking to make everything fit nicely into the shape.

BTW, as mentioned here, the term "ASCII Art" may include several types of visual art besides the traditional ASCII character set type. There is also this version, where the whole image is converted to strings of various different characters to give the art greater contrast & intensity. 

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

44 minutes ago, R C-R said:

BTW, as mentioned here, the term "ASCII Art" may include several types of visual art besides the traditional ASCII character set type. There is also this version, where the whole image is converted to strings of various different characters to give the art greater contrast & intensity. 

I first worked with it back in 1966, when in a programming class we were given the assignment to "read and print a card". The instructor figured we would read a physical 80-character punched card and print it out.

My friends produced a playing card (ace of spades, or something like that) in ASCII art, punched it into a deck of cards, read and printed the deck of cards, to reproduce the ASCII art on a printer.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

47 minutes ago, R C-R said:

may include several types of visual art besides the traditional ASCII character set type.

There is wide range of possibilities to manipulate text 'just' via code. One of the tools is for instance 'Processing', a language which seems to be specialized for generative image creation / manipulation.

http://www.generative-gestaltung.de/1/code

1030918736_processing1.jpg.d70c662d17398f448c456ec88850757d.jpg1066273103_processing2.jpg.dc88683a35b90a9f9069541defcb31fd.jpg1885144786_processing3.jpg.e0ac524912c1bd52db147c707853f7b0.jpg1197070827_processing4.jpg.408a964830b915ed58380a270b7095c6.jpg

The last example doesn't use text actually but any collection of custom vector objects. It can be letters/characters, simple shapes, icons, logos etc.
What I additionally appreciate in this code package is the ability of PDF output, which maintains vector and lossless scaling.

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

2 minutes ago, walt.farrell said:

My friends produced a playing card (ace of spades, or something like that) in ASCII art, punched it into a deck of cards, read and printed the deck of cards, to reproduce the ASCII art on a printer.

I was not interested in computer science way back when I was in college, but quite a few of my fellow students were. Our tiny state college was unusual in having a brand new for the era computer science center with a huge IBM mainframe system, complete with massive tape drives, line printers, card readers, & so on. Lots of the CS majors created ASCII line art & posted it all over the campus, but the most unusual thing one of them did that set him apart from the others was to write a program that when run not only printed out an ASCII art image of the outline of a Christmas tree, also played a Christmas song on transistor radios placed near the computer terminal.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

3 hours ago, JJohn1980 said:

Well, I thought the video is pretty self explanatory, but I will try to do it in words too:

1. log into https://www.mockofun.com/

2. Upload the image of the logo and add it to the work area

3. Select the image, go to FILTERS (upper menu) and add the ASCII art filter

The missing piece of the puzzle for me was that although I had the image displayed in the workspace I didn’t have it selected to show the adjustment handles. Once I did that, the relevant options appeared at the top of the screen and it was all plain sailing. Thanks again.

Alfred spacer.png
Affinity Designer/Photo/Publisher 2 for Windows • Windows 10 Home/Pro
Affinity Designer/Photo/Publisher 2 for iPad • iPadOS 17.4.1 (iPad 7th gen)

Link to comment
Share on other sites

> java SampleASCIIArt      
  
              $$$$        $$$$$       $$$$$        $$$$      $$$$$
              $$$$        $$$$$$      $$$$$        $$$$      $$$$$$
              $$$$        $$$$$$      $$$$$        $$$       $$$$$$
              $$$$       $$$$$$$       $$$$$      $$$$      $$$$$$$
              $$$$       $$$$$$$$      $$$$$      $$$$      $$$$$$$$
              $$$$      $$$$$$$$$      $$$$$$     $$$      $$$$$$$$$
              $$$$      $$$$ $$$$$      $$$$$    $$$$      $$$$ $$$$$
              $$$$      $$$$ $$$$$      $$$$$    $$$$      $$$$ $$$$$
              $$$$     $$$$  $$$$$       $$$$$  $$$$      $$$$  $$$$$
              $$$$     $$$$   $$$$$      $$$$$  $$$$      $$$$   $$$$$
              $$$$     $$$    $$$$$      $$$$$  $$$$      $$$    $$$$$
              $$$$    $$$$$$$$$$$$$       $$$$$$$$$      $$$$$$$$$$$$$
              $$$$    $$$$$$$$$$$$$$      $$$$$$$$$      $$$$$$$$$$$$$$
              $$$$   $$$$$$$$$$$$$$$      $$$$$$$$$     $$$$$$$$$$$$$$$
              $$$$   $$$$       $$$$$      $$$$$$$      $$$$       $$$$$
              $$$$   $$$$       $$$$$      $$$$$$$      $$$$       $$$$$
              $$$$  $$$$        $$$$$       $$$$$      $$$$        $$$$$
             $$$$$  $$$$         $$$$$      $$$$$      $$$$         $$$$$
         $$$$$$$$$
         $$$$$$$$$
         $$$$$$$$
         $$$$$$       
> java SampleASCIIArt Affinity
                                $$$$$$$   $$$$$$$
                $$$$$          $$$$$$$$  $$$$$$$$ $$$$                    $$$$
                $$$$$$        $$$$$$$$$ $$$$$$$$$ $$$$                    $$$$
                $$$$$$        $$$$$     $$$$$     $$$$                    $$$$    $$$$
               $$$$$$$        $$$$$     $$$$$                                     $$$$
               $$$$$$$$       $$$$      $$$$                     $$               $$$$
              $$$$$$$$$     $$$$$$$$$$$$$$$$$$$$  $$$$    $$$$ $$$$$$     $$$$  $$$$$$$$$ $$$$$     $$$$
              $$$$ $$$$$    $$$$$$$$$$$$$$$$$$$$  $$$$    $$$$$$$$$$$$    $$$$  $$$$$$$$$ $$$$$     $$$$
              $$$$ $$$$$    $$$$$$$$$$$$$$$$$$$$  $$$$    $$$$$$$$$$$$    $$$$  $$$$$$$$$  $$$$$   $$$$
             $$$$  $$$$$      $$$$      $$$$      $$$$    $$$$$$ $$$$$    $$$$    $$$$     $$$$$   $$$$
             $$$$   $$$$$     $$$$      $$$$      $$$$    $$$$$   $$$$    $$$$    $$$$     $$$$$  $$$$
             $$$    $$$$$     $$$$      $$$$      $$$$    $$$$    $$$$    $$$$    $$$$      $$$$$ $$$$
            $$$$$$$$$$$$$     $$$$      $$$$      $$$$    $$$$    $$$$    $$$$    $$$$      $$$$$ $$$
            $$$$$$$$$$$$$$    $$$$      $$$$      $$$$    $$$$    $$$$    $$$$    $$$$      $$$$$$$$$
           $$$$$$$$$$$$$$$    $$$$      $$$$      $$$$    $$$$    $$$$    $$$$    $$$$       $$$$$$$$
           $$$$       $$$$$   $$$$      $$$$      $$$$    $$$$    $$$$    $$$$    $$$$$      $$$$$$$
           $$$$       $$$$$   $$$$      $$$$      $$$$    $$$$    $$$$    $$$$    $$$$$$$     $$$$$$
          $$$$        $$$$$   $$$$      $$$$      $$$$    $$$$    $$$$    $$$$    $$$$$$$     $$$$$
          $$$$         $$$$$  $$$$      $$$$      $$$$    $$$$    $$$$    $$$$     $$$$$$     $$$$$
                                                                                    $$$$$     $$$$
                                                                                             $$$$$
                                                                                             $$$$
                                                                                            $$$$$
                                                                                            $$$$
                                                                                            $$$$

The tiny Java based sample prog to generate the above shown ASCII texts ...

import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;

public class SampleASCIIArt {

    public static void main(String[] args) throws IOException {

        int width = 100;
        int height = 30;
        String textArg = "JAVA";

        for (String arg : args) {
            textArg = args[0];
        }

        BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
        Graphics g = image.getGraphics();
        g.setFont(new Font("SansSerif", Font.BOLD, 24));

        Graphics2D graphics = (Graphics2D) g;
        graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
                RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        graphics.drawString(textArg, 10, 20);

        for (int y = 0; y < height; y++) {
            StringBuilder sb = new StringBuilder();
            for (int x = 0; x < width; x++) {
                sb.append(image.getRGB(x, y) == -16777216 ? " " : "$");
            }

            if (sb.toString().trim().isEmpty()) {
                continue;
            }

            System.out.println(sb);
        }
    }
}

 

... to compile it via an installed Java >= 8 system on your computer system, use the Java compiler javac in a terminal and call ...

  • >   javac SampleASCIIArt.java             (will compile the Java source file and create a Java binary class file)

... which will compile the SampleASCIIArt.java source file and generate a SampleASCIIArt.class Java binary class file. - To run the generated Java class file in a terminal, change into the directory where the class file resides and just perform ...

  • >   java SampleASCIIArt                        (will output as default "JAVA")
  • >   java SampleASCIIArt  Affinity         (will output "Affinity")
  • >   java SampleASCIIArt  WhatEver     (will output "WhatEver")

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

11 hours ago, v_kyr said:
                sb.append(image.getRGB(x, y) == -16777216 ? " " : "$");

when I posted the question I would never have imagined that we would get to Java code.

as it happens, I'm a Java programmer, so I can read your answer. To me this code seems to transform an image like this any white pixel becomes a space, anything else becomes a $. This would work for black and white images like the original apple logo

 

however, I like using mockofun's ascii filter because it seems to use different brightness levels associated with different characters. I read somewhere that they actually map each brightness level to a specific character according to the character's "coverage"

they seem to have really put some thought into the multiple types of ascii art like for ex. using the Newskool characters.

 

having said that, I'd like to thank you all for giving me a very good insight into this and helping me find out more about monospace fonts and ascii art

Link to comment
Share on other sites

2 hours ago, JJohn1980 said:

... as it happens, I'm a Java programmer, so I can read your answer. To me this code seems to transform an image like this any white pixel becomes a space, anything else becomes a $. This would work for black and white images like the original apple logo ...

Yes,

when drawing Strings, the Java Graphics2D class uses a simple matrix-like technique where regions which carve out the designed Strings are assigned a particular value while others are given a zeroth value. In order to be able to replace the carved area with a desired ASCII character, one needs to detect the values of the carved region as a single data point (e.g. integer) and not the RGB color values. To have the image's RGB color represented as an integer, the image type is set to integer mode:

BufferedImage bufferedImage = new BufferedImage(
  width, height, 
  BufferedImage.TYPE_INT_RGB);

Now the idea is to replace the values assigned to non-zero indices of the image matrix with the desired artistic character. While indices of the matrix representing the zero value will be assigned a single space character. The zero equivalent of the integer mode is -16777216. Now, we have a 2D graphics whose underlying matrix contains two types of discriminated values; non-zero and zero indices. Then we will go through the 2-dimensional array (or matrix) and replace all values equal to -16777216 with ” ” and the rest with “$”.

4 hours ago, JJohn1980 said:

however, I like using mockofun's ascii filter because it seems to use different brightness levels associated with different characters. I read somewhere that they actually map each brightness level to a specific character according to the character's "coverage"

For ASCII art there are a bunch of enhancements possible, like adapting to an image's initial pixel coloring and using different characters for those etc. So all in all there are a bunch of different methods possible to deal with that.

Here's the output of your Apple logo from some other Java based ASCII-art routines ...

apfel_large.png.8e4d14266886b89b960ba6764944774e.pngapfel_medium.png.09ac0c76bdb0b54cf3319e5092d2979f.pngapfel_small.png.e2d020bf436bb2f3939fac4ebdc0aa41.png

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

On 5/25/2022 at 2:14 PM, JJohn1980 said:

…the tool's ASCII photo filter allows me to download the result as an image or grab the actual text from the ascii art and I can paste it into affinity, but it's not the same proportions. do I have to use a certain font? how do I do this using the text and not the image.

I've used Monodraw (macOS only I'm afraid) in the past to help convert ASCII art to SVG for use in Designer and Publisher without having to tweak the font, size, leading, spacing, etc within a text frame in the Affinity apps to get the same character layout. If you need the text to remain text this isn't an option, but if you're just looking for a way to get clean, vector, outlines of ASCII art this works pretty well.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.