Created
November 3, 2012 21:09
-
-
Save jtrim/4008820 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| image_data = IO.read('test.png') | |
| pngquant_io = IO.popen('pngquant 16') | |
| pngquant_io.write image_data | |
| pngquant_io.close_write | |
| processed_data = pngquant_io.read | |
| open 'test-processed.png', 'wb' do |f| | |
| f.write processed_data | |
| end | |
| pngquant_io.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment