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
require 'chunky_png' | |
require 'zbar' | |
#Turns Colour PNG into 8bit BW Y800 string. | |
# @param image [ChunckyPNG::Image] | |
# @return [String] Y800 image, as a string | |
def png_to_y800(image) | |
y800 = "" | |
(0...image.height).each do |h| | |
(0...image.width).each do |w| |