Skip to content

Instantly share code, notes, and snippets.

@seki
Created December 9, 2021 11:14
Show Gist options
  • Save seki/40e83b4fc0bd17e44c5e8d0eeda4c2c9 to your computer and use it in GitHub Desktop.
Save seki/40e83b4fc0bd17e44c5e8d0eeda4c2c9 to your computer and use it in GitHub Desktop.
create 16bit PGM
name = ARGV.shift || 'p5.pgm'
buf = "P5 256 256 65535\n" + (0...(256 ** 2)).to_a.pack('n*')
File.write(name, buf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment