< Back

Convert-ImageToAscii

Fri Jan 10, 2020 8:56 pm

NAME Convert-ImageToAscii



SYNOPSIS

Convert image to ascii.





SYNTAX

Convert-ImageToAscii [-Path] <FileInfo> [-Resolution <String>] -Width <Int32> -Height <Int32> [-Invert]

[<CommonParameters>]



Convert-ImageToAscii [-Path] <FileInfo> [-Resolution <String>] [-FitConsoleHeight] [-Invert] [<CommonParameters>]





DESCRIPTION

Convert any image to ascii picture by representing each pixels grayscale value as an ascii character.





PARAMETERS

-Path <FileInfo>

The path to the image to process.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Resolution <String>

The amount of different ascii characters the grayscale values will be assigned to.



Required? false

Position? named

Default value Low

Accept pipeline input? false

Accept wildcard characters? false



-Width <Int32>

Set the width of the output ascii picture manually.



Required? true

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-Height <Int32>

Set the height of the output ascii picture manually.



Required? true

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-FitConsoleHeight [<SwitchParameter>]

Whether the output ascii picture should fit the console height instead of width. Only applicable if

width and height are not explicitly specified.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Invert [<SwitchParameter>]

Whether the output ascii picture should be inverted. Use this on light console backgrounds

for better results.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.IO.FileInfo

System.String

System.Int32





OUTPUTS

System.String





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Convert-ImageToAscii C:\\Users\\Bobby\\Pictures\\bobby-fischer.jpg













-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Convert-ImageToAscii -Path C:\\Users\\Bobby\\Pictures\\bobby-fischer.jpg -Resolution Mid -FitConsoleHeight













-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Convert-ImageToAscii -Path C:\\Users\\Bobby\\Pictures\\bobby-fischer.jpg -Width 120 -Height 80 -Invert













-------------------------- EXAMPLE 4 --------------------------



PS C:\\>Get-ChildItem C:\\Users\\Bobby\\Pictures\\*.jpg | Convert-ImageToAscii -FitConsoleHeight















RELATED LINKS