How To Create ASCII Art with PowerShell

You can do funny things PowerShell. With a few lines of PowerShell code you can turn any image into ASCII art. With the PowerShell function below you simply load the image, then it will scan the image line by line and row by row, and replaces each pixel with an ASCII character, based on the pixel brightness.

PowerShell function

Add the following lines to create your ASCII art:

Just make sure you adjust the paths in the code. The ASCII art opens in your default text editor. Make sure you disable line wrap, choose a fixed-width font and a small-enough font size.

In the function Convert-ImageToASCIIArt, take a look at $Characters. It is a string with the characters used in your ASCII art, and the characters are listed in descending brightness. For a black and white drawing, you could as well try:

I really like to hear what you have to say about this article:

  • Was this article helpful for you or do you have any questions?
  • Do you have additions, suggestions or any other ideas?
  • Just let me know by leaving a comment below.

Thank you for spending some time at my site and in my blog. I hope you come to visit again soon 😉

About Lex van der Horst 201 Articles

Be the first to comment

Leave a Reply