The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
| #!/usr/bin/python | |
| from PIL import Image # open PNG and get raw (bitmap) data bytes | |
| import struct # we use struct to convert between integers and byte values | |
| im = Image.open("input.png") # input file | |
| filea = open('framea.bin','wb') # field A output file | |
| fileb = open('frameb.bin','wb') # field B output file | |
| filepointer = fileb |