21 lines
741 B
PowerShell
21 lines
741 B
PowerShell
Add-Type -AssemblyName System.Drawing
|
|
$b = [System.Drawing.Bitmap]::FromFile($args[0])
|
|
function PixClass([System.Drawing.Color]$c) {
|
|
if ($c.A -lt 100) { return '.' }
|
|
if ($c.R -gt 180 -and $c.G -gt 130 -and $c.B -lt 120) { return 'G' }
|
|
if ($c.R -gt 200 -and $c.G -gt 200 -and $c.B -gt 200) { return 'W' }
|
|
if ($c.R -gt 90 -and $c.G -lt 70) { return 'R' }
|
|
return 'x'
|
|
}
|
|
$s = New-Object System.Text.StringBuilder
|
|
for ($x = 0; $x -lt 724; $x += 4) { [void]$s.Append((PixClass ($b.GetPixel($x, 362)))) }
|
|
"row362: " + $s.ToString()
|
|
foreach ($cx in 110, 615) {
|
|
$s = New-Object System.Text.StringBuilder
|
|
for ($y = 0; $y -lt 724; $y += 4) { [void]$s.Append((PixClass ($b.GetPixel($cx, $y)))) }
|
|
"col$($cx): " + $s.ToString()
|
|
}
|
|
$b.Dispose()
|
|
|
|
|