Being honest, I’m not very proud of this script 🙂 , but I like the Beauty how “Thoughts become Things” ( Idea -> Script )

INTRODUCTION AND DEFINITIONS :

Yesterday, I was thinking about my graduation days how Image Processing in MatLab used to fascinate me! So I thought giving Images a try in Powershell.

Just to see if an Image can be drawn in the Powershell console I did some (A lot!) research and ended up with this script, but before we delve into it its time for some definitions which are following –

WHAT IS A PIXEL ?

A Pixel (a word invented from “Picture Element“) is the basic unit of programmable color on a computer display or in a computer image.

Pixels indicates a color for each image unit along the horizontal axis or row (called the x coordinate) and a color for each Image unit along the vertical axis (called the y coordinate).

WHAT IS A BITMAP ?

A bit map (often spelled “bitmap”) defines a display space and the color for each pixel or “bit” in the display space.

A Graphics Interchange Format (GIF) and a JPEG are examples of graphic image file types that contain bit maps. Pixels are nothing but color information spread on X, Y coordinates.

Following diagram show the directions in which pixels are spread across X and Y axis.

HOW IT WORKS :

LIMITATIONS :

COLORS : Console is limited to only 16 colors leaving us with less choices. Hence, I have to write a small algorithm to find the Closest console color matching the color in a Pixel.

So you want find the Image in the console very beautiful, but good part is it at least works 😉 SPEED : Speed of drawing Image in a console depends heavily on the number of Pixels in the Image that is width multiplied by the height, so I would recommend that your image size doesn’t cross 150X150 otherwise image will be drawn a pretty slow pace, since the number of iterations will increase drastically for larger images. NumberOfPixels = Width * Height of the Image

HOW TO RUN :

*This animation is a high speed version of the Original

GET THE SCRIPT :

Grab the script from my GitHub Repo Here

Hoping you’ll find it fun!! 🙂

Prateek Singh

Follow @SinghPrateik