create_texture__mcl_particles_nether_portal.py 365 B

12345678910111213141516171819202122
  1. import png
  2. s = [
  3. '0000010',
  4. '0101100',
  5. '0010111',
  6. '0101010',
  7. '1010111',
  8. '0001100',
  9. '0010100',
  10. ]
  11. s = [[int(c) for c in row] for row in s]
  12. # R, G, B, Alpha (0xFF = opaque):
  13. palette=[(0x00,0x00,0x00,0x00), (0xcf,0x00,0xcf,0xe0)]
  14. w = png.Writer(len(s[0]), len(s), palette=palette, bitdepth=1)
  15. f = open('mcl_particles_nether_portal.png', 'wb')
  16. w.write(f, s)