3 category: Ruby libraries
10 image = ChunkyPNG::Image.from_file('file.png')
16 image = ChunkyPNG::Image.from_blob(File.read('file.png'))
17 image = ChunkyPNG::Image.from_io(io)
20 Loads from `file.png`.
25 image.save('filename.png')
31 File.open('newfile.png', 'wb') { |io| image.write(io) }
32 binary_string = image.to_blob
35 Writes an image to `newfile.png`.
40 image[0, 0] = ChunkyPNG::Color.rgba(255, 0,0, 128)
41 image.line(1, 1, 10, 1, ChunkyPNG::Color.from_hex('#aa007f'))
53 new_image = image.flip_horizontally.rotate_right