A PowerShell module that converts Pixquare .px files to terminal pixel graphics using ANSI True Color in terminals that support ANSI escape sequences and ConsoleColor in terminals that don't. (Please don't use ISE anymore...)
From the PowerShell Gallery (preferred):
Install-Module -Name PX2PS -Scope CurrentUser -ForceFrom source:
# Clone the repository
git clone https://github.com/jakehildreth/PX2PS.git
# Import the module
Import-Module ./PX2PS/PX2PS.psd1# Convert and display a .px file
Convert-PX2PS -Path "image.px"
# Convert all .px files in a directory using alias
px2ps -Path "C:\PixelArt"
# Pipeline support
Get-ChildItem -Path . -Filter "*.px" | Convert-PX2PS
# Get scriptblock for deferred rendering
$sb = Convert-PX2PS -Path "logo.px" -OutputMode ScriptBlock
& $sb
# Generate standalone script file
Convert-PX2PS -Path "banner.px" -OutputMode Script -OutputPath "banner.ps1"
# -PassThru to get pixel data without rendering
$imageData = px2ps -Path "image.px" -PassThru
Write-Host "Dimensions: $($imageData.Width)x$($imageData.Height)"
- Renders .px files directly in the terminal using ANSI True Color
- Supports single-layer and multi-layer .px files
- Automatic layer compositing and transparency handling
- ScriptBlock output for deferred rendering
- Standalone script generation
- Cross-platform support (Windows, Linux, macOS)
- PowerShell 5.1+ compatible
- Pipeline input support
- PowerShell 5.1 or later
PX2PS reads Pixquare .px files, decompresses the zlib-encoded layer data, composites multiple layers if present, and renders the final image using Unicode lower half block characters (▄) with ANSI True Color escape sequences. Each terminal line represents two rows of pixels.
In terminals that do not support ANSI sequences (e.g., PowerShell ISE), pixels are written using ConsoleColor instead of ANSI.
MIT License w/Commons Clause - see LICENSE file for details.
Made with 💜 by Jake Hildreth
