Skip to content

Instantly share code, notes, and snippets.

View rbur004's full-sized avatar

Rob Burrowes rbur004

  • Karekare, New Zealand
View GitHub Profile
@rbur004
rbur004 / gist:f3615da42dc163de83d7e9e1f386892d
Last active October 1, 2016 22:54
Chunky_png with Zbar
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|