Skip to content

PX2PS is a PowerShell utility module for converting Pixquare format (.px) files into PowerShell terminal graphics.

License

Notifications You must be signed in to change notification settings

jakehildreth/PX2PS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A graphic that combines the Pixquare logo (the letters P and x in a pixelated style) with the PowerShell Core logo (A >_ console icon tilted to the right.)

PX2PS

A PowerShell module that converts Pixquare .px files to terminal pixel graphics using ANSI True Color.

Installation

From Source

# Clone the repository
git clone https://github.com/jakehildreth/PX2PS.git

# Import the module
Import-Module ./PX2PS/PX2PS.psd1

Quick Start

# 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)"

Features

  • 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

Requirements

  • PowerShell 5.1 or later (ISE is not supported.)
  • Terminal with True Color (24-bit color) support

How It Works

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.

License

MIT License w/Commons Clause - see LICENSE file for details.


Made with 💜 by Jake Hildreth

About

PX2PS is a PowerShell utility module for converting Pixquare format (.px) files into PowerShell terminal graphics.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published