generate-alt-random: emit multiple sixel bands

This ensures we’re getting the ‘$’ command PGO:d
This commit is contained in:
Daniel Eklöf 2021-03-07 17:31:42 +01:00
parent ae86043780
commit f8e51fcb17
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -165,7 +165,7 @@ def main():
# The sixel 'alphabet' # The sixel 'alphabet'
sixels = '?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~' sixels = '?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'
for _ in range(200): for _ in range(100):
# Offset image # Offset image
out.write(' ' * (random.randrange(cols // 2))) out.write(' ' * (random.randrange(cols // 2)))
@ -188,6 +188,8 @@ def main():
out.write(f'"1;1;{six_width};{six_height}') out.write(f'"1;1;{six_width};{six_height}')
for row in range(six_height // 6): # Each sixel is 6 pixels for row in range(six_height // 6): # Each sixel is 6 pixels
band_count = random.randrange(32)
for band in range(band_count):
# Choose a random color # Choose a random color
out.write(f'#{random.randrange(256)}') out.write(f'#{random.randrange(256)}')
@ -198,6 +200,11 @@ def main():
out.write(f'!{six_width}{random.choice(sixels)}') out.write(f'!{six_width}{random.choice(sixels)}')
# Next line # Next line
if band + 1 < band_count:
# Move cursor to beginning of current row
out.write('$')
elif row + 1 < six_height // 6:
# Newline
out.write('-') out.write('-')
# End sixel # End sixel