-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate-samples.ps1
More file actions
151 lines (123 loc) · 7.68 KB
/
generate-samples.ps1
File metadata and controls
151 lines (123 loc) · 7.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# Generate all sample images for README documentation
# Run from the ConsoleImage root directory
$ErrorActionPreference = "Stop"
$samplesDir = "samples"
if (-not (Test-Path $samplesDir)) {
New-Item -ItemType Directory -Path $samplesDir | Out-Null
}
Write-Host "Building project..." -ForegroundColor Cyan
dotnet build --verbosity quiet
Write-Host "`nGenerating sample images..." -ForegroundColor Cyan
# Source images (absolute paths)
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$portrait = Join-Path $scriptDir "demo_portrait.jpg"
$mountain = Join-Path $scriptDir "demo_mountain.jpg"
$wiggum = Join-Path (Join-Path $scriptDir "samples") "wiggum_loop.gif"
# Check if source images exist
if (-not (Test-Path $portrait)) {
Write-Host "Warning: $portrait not found - skipping portrait samples" -ForegroundColor Yellow
}
if (-not (Test-Path $mountain)) {
Write-Host "Warning: $mountain not found - skipping mountain samples" -ForegroundColor Yellow
}
if (-not (Test-Path $wiggum)) {
Write-Host "Warning: $wiggum not found - skipping animation samples" -ForegroundColor Yellow
}
function Generate-Sample {
param(
[string]$InputFile,
[string]$OutputFile,
[string]$ExtraArgs,
[string]$Description
)
if (-not (Test-Path $InputFile)) {
Write-Host " Skipping $OutputFile (input not found)" -ForegroundColor Yellow
return
}
Write-Host " $Description" -ForegroundColor White
$cmd = "dotnet run --project ConsoleImage -- `"$InputFile`" -o gif:$samplesDir/$OutputFile --colors 256 $ExtraArgs"
Invoke-Expression $cmd 2>&1 | Out-Null
}
# Portrait samples - ASCII mode (note: -a required since braille is now default)
Generate-Sample $portrait "demo_portrait_ascii.gif" "-a -w 80" "Portrait ASCII"
Generate-Sample $portrait "demo_portrait_blocks.gif" "-b -w 80" "Portrait Blocks"
Generate-Sample $portrait "demo_portrait_braille.gif" "-B -w 80" "Portrait Braille"
Generate-Sample $portrait "demo_portrait_edge.gif" "-a -w 80 --edge" "Portrait Edge Detection"
Generate-Sample $portrait "demo_portrait_simple.gif" "-a -w 80 -p simple" "Portrait Simple Preset"
Generate-Sample $portrait "demo_portrait_block.gif" "-a -w 80 -p block" "Portrait Block Preset"
# Mountain/landscape samples
Generate-Sample $mountain "demo_mountain_ascii.gif" "-a -w 100" "Mountain ASCII"
Generate-Sample $mountain "demo_mountain_blocks.gif" "-b -w 100" "Mountain Blocks"
Generate-Sample $mountain "demo_mountain_braille.gif" "-B -w 100" "Mountain Braille"
# Animation samples (wiggum)
Generate-Sample $wiggum "wiggum_ascii.gif" "-a -w 80" "Animation ASCII"
Generate-Sample $wiggum "wiggum_blocks.gif" "-b -w 80" "Animation Blocks"
Generate-Sample $wiggum "wiggum_braille.gif" "-B -w 80" "Animation Braille"
Generate-Sample $wiggum "wiggum_mono.gif" "--mono -w 80" "Animation Monochrome"
# Gamma comparison samples (ASCII mode)
Generate-Sample $portrait "demo_gamma_1.0.gif" "-a -w 80 --gamma 1.0" "Portrait Gamma 1.0 (no correction)"
Generate-Sample $portrait "demo_gamma_0.85.gif" "-a -w 80 --gamma 0.85" "Portrait Gamma 0.85 (default - brighter)"
Generate-Sample $portrait "demo_gamma_0.7.gif" "-a -w 80 --gamma 0.7" "Portrait Gamma 0.7 (much brighter)"
# Matrix mode samples
Generate-Sample $portrait "matrix_portrait_final.gif" "-w 60 --matrix --gif-length 3" "Matrix Classic Green"
Generate-Sample $mountain "matrix_mountain_fullcolor.gif" "-w 80 --matrix --matrix-fullcolor --gif-length 3" "Matrix Full Color"
Generate-Sample $portrait "matrix_binary.gif" "-w 60 --matrix --matrix-alphabet 01 --gif-length 3" "Matrix Binary Rain"
# Moviebill samples (logo animation)
$moviebill = Join-Path (Join-Path $scriptDir "samples") "moviebill-logo.gif"
Generate-Sample $moviebill "moviebill_ascii.gif" "-a -w 60" "Moviebill ASCII"
Generate-Sample $moviebill "moviebill_blocks.gif" "-b -w 60" "Moviebill Blocks"
Generate-Sample $moviebill "moviebill_braille.gif" "-B -w 60" "Moviebill Braille"
Generate-Sample $moviebill "moviebill_mono.gif" "--mono -w 60" "Moviebill Monochrome"
Generate-Sample $moviebill "moviebill_matrix.gif" "--matrix -w 60" "Moviebill Matrix"
Generate-Sample $moviebill "moviebill_matrix_red.gif" "--matrix --matrix-color red -w 60" "Moviebill Matrix Red"
# Boingball samples (classic Amiga demo)
$boingball = "F:/gifs/boingball_10_80x80_256.gif"
Generate-Sample $boingball "boingball_ascii.gif" "-a -w 60" "Boingball ASCII"
Generate-Sample $boingball "boingball_blocks.gif" "-b -w 60" "Boingball Blocks"
Generate-Sample $boingball "boingball_braille.gif" "-B -w 60" "Boingball Braille"
Generate-Sample $boingball "boingball_mono.gif" "--mono -w 60" "Boingball Monochrome"
# Earth samples (color fidelity test - rich colors on dark background)
$earth = "F:/gifs/Earth.gif"
Generate-Sample $earth "earth_braille.gif" "-B -w 60" "Earth Braille"
Generate-Sample $earth "earth_blocks.gif" "-b -w 60" "Earth Blocks"
# Hack the Planet samples (Hackers movie - great for Matrix mode)
$hackers = "F:/gifs/hacktheplanet.gif"
Generate-Sample $hackers "hacktheplanet_ascii.gif" "-a -w 80" "Hack the Planet ASCII"
Generate-Sample $hackers "hacktheplanet_braille.gif" "-B -w 60" "Hack the Planet Braille"
Generate-Sample $hackers "hacktheplanet_matrix.gif" "--matrix -w 60" "Hack the Planet Matrix"
# Fifth Element samples (vibrant sci-fi)
$fifthelement = "F:/gifs/fifthelement_beckon.gif"
Generate-Sample $fifthelement "fifthelement_braille.gif" "-B -w 60" "Fifth Element Braille"
# Jurassic Park samples (iconic scene)
$jurassicpark = "F:/gifs/JurassicPark.gif"
Generate-Sample $jurassicpark "jurassicpark_braille.gif" "-B -w 60" "Jurassic Park Braille"
# Status line samples - showing progress/info below the frame
Generate-Sample $wiggum "status_ascii.gif" "-a -w 80 --status" "Animation with Status Line (ASCII)"
Generate-Sample $wiggum "status_braille.gif" "-B -w 80 --status" "Braille with Status Line (burned in)"
# Video samples with status line (short clips)
$video = "C:/Users/scott/OneDrive/Videos/Count.Arthur.Strong.S02E03.HDTV.x264-TASTETV.mp4"
if (Test-Path $video) {
Write-Host " Video ASCII with Status" -ForegroundColor White
dotnet run --project ConsoleImage -- "$video" -a -o "gif:$samplesDir/video_ascii_status.gif" -w 80 --colors 256 --status --duration 3 2>&1 | Out-Null
Write-Host " Video Blocks" -ForegroundColor White
dotnet run --project ConsoleImage -- "$video" -b -o "gif:$samplesDir/video_blocks.gif" -w 80 --colors 256 --duration 3 2>&1 | Out-Null
Write-Host " Video Mono with Status" -ForegroundColor White
dotnet run --project ConsoleImage -- "$video" --mono -o "gif:$samplesDir/video_mono_status.gif" -w 80 --colors 256 --status --duration 3 2>&1 | Out-Null
Write-Host " Video to CIDZ (compressed, ASCII)" -ForegroundColor White
dotnet run --project ConsoleImage -- "$video" -a -o "$samplesDir/video_sample.cidz" -w 60 --duration 5 2>&1 | Out-Null
} else {
Write-Host " Skipping video samples (video not found)" -ForegroundColor Yellow
}
# Star Trek TNG video samples
$startrek = "C:/Users/scott/OneDrive/Videos/StarTrek.TNG-s01e01.Encounter.at.Farpoint.mkv"
if (Test-Path $startrek) {
Write-Host " Star Trek Braille (video)" -ForegroundColor White
dotnet run --project ConsoleImage -- "$startrek" -B -o "gif:$samplesDir/startrek_braille.gif" -w 60 --colors 256 -ss 120 --duration 3 2>&1 | Out-Null
} else {
Write-Host " Skipping Star Trek samples (video not found)" -ForegroundColor Yellow
}
# Compressed document sample (moviebill as .cidz)
Write-Host " Moviebill CIDZ" -ForegroundColor White
dotnet run --project ConsoleImage -- "$moviebill" -o "$samplesDir/moviebill-logo.cidz" -B -w 60 2>&1 | Out-Null
Write-Host "`nDone! Samples generated in $samplesDir/" -ForegroundColor Green
Write-Host "Remember to commit the updated samples to git." -ForegroundColor Cyan