Created
April 22, 2011 00:25
-
-
Save jbrechtel/935773 to your computer and use it in GitHub Desktop.
This file contains 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
rgb_values = "ffaaffaabbccdd3322fa352fda2" | |
decimal_values = [] | |
rgb_values.each_slice(2) do |pair| | |
decimal_values << pair.join("").hex | |
end | |
File.open('test.jpg', 'wb') do |file| | |
file.print(decimal_values.pack("c*")) | |
end |
This file contains 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
rgb_values = "ffaaffaabbccdd3322fa352fda2" | |
decimal_values = [] | |
rgb_values.each_slice(2) do |pair| | |
decimal_values << pair.join("").hex | |
end | |
File.open('test.jpg', 'wb') do |file| | |
file.print(decimal_values.pack("c*")) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment