aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-03-06 20:20:11 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-03-11 16:32:56 +0000
commitadd30a38f3aaa702c065ed0e267f72371df24313 (patch)
tree0dada6059ab84f98f7470b84b53edf0974a03dfc /scripts
parentsixel: add: simplify check for resize needed (diff)
scripts: generate-alt-random: sixel: emit DECGRI - Repeat Character
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generate-alt-random-writes.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/generate-alt-random-writes.py b/scripts/generate-alt-random-writes.py
index 2e51082b..6e7b25ab 100755
--- a/scripts/generate-alt-random-writes.py
+++ b/scripts/generate-alt-random-writes.py
@@ -184,17 +184,18 @@ def main():
six_width = random.randrange(width // 2)
# Sixel size. Without this, sixels will be
- # auto-resized on cell-boundaries. We expect programs
- # to emit this sequence since otherwise you cannot get
- # correctly sized images.
+ # auto-resized on cell-boundaries.
out.write(f'"0;0;{six_width};{six_height}')
for row in range(six_height // 6): # Each sixel is 6 pixels
# Choose a random color
out.write(f'#{random.randrange(256)}')
- for col in range(six_width):
- out.write(f'{random.choice(sixels)}')
+ if random.randrange(2):
+ for col in range(six_width):
+ out.write(f'{random.choice(sixels)}')
+ else:
+ out.write(f'!{six_width}{random.choice(sixels)}')
# Next line
out.write('-')