require 'base64' require 'zlib' require 'stringio' img = StringIO.new Zlib.inflate Base64.decode64 DATA.read sig = img.gets.chomp width, height = img.gets.split.map &:to_i depth = img.gets.to_i img = img.read.bytes gets.to_i.times{ y,x=gets.split.map &:to_i p img[y*width+x]*3 } # icon.ppm.zlib.b64 __END__ eNrtmc1x4zAMhXH2CSWwBGRnPLN7UwkqgSWoBJagElQCS2AJKoElqISNOY4Rz1NCh4QOmdE7+KKf z/wsgLA9Xi9v8ub+/rv8uV4v25kDk/N2dHL0EtJ2ZNZ5IDcQT/Gw5aQgJMMtTOOy6gFLT8zDI0L2 1tZlJDc8h0mtmXnCODNrOU4MCFtrWT3tR7j3WVtn8GRtLaEnY2t58cTD6ykV2lLaEEtrKTjwZGst x+KpMaQVWivtnmBfq5e2sbWcpnZPL/a1KOrJII5cREiGZ6rLmIOlQHX0rmKYdz/7DHXeGia/3O8G H4lPuRzQjtXmiaf7jeKYAELsl6y9txFRPN3rjRDCqrLsItzoSeuNEUL3xcas++EPn6f0uJRvl9Ie RLvCj62pBO1L+xDtCnPSC17zFD97GqoQsMbysievJ9cgugNh06x7qkOwl+Ll6En3uToE8tka8Y6n 8PBEenkFgmG0hp5mXGgdUreGnpogaF61FE8wD7RD9FmbP6ypJ90ZWiDivrMGnpog4iemL62BpzYI hW0Njr6oPPXUCSk32rVB/v2Y13P7IOX9IkYKRKwgZe8CLa5AnAFkhi9a9hDn1+f5W4whJSJPY1Py YghRCruwwjEriIZ5epyTLCE4mR+2Emwk9hDY6vMBEJw84+ysIYg5pE4wJ+SEnJCjIAyQhUZjyEgR V8LGEEJdOs/ZQEi3cPyB1gQigABML0RoWPL2TbKOjY0QoREQiFkAg5AehI6N0gRxNEZF1DBxJFeF IMIrou3XYYTgaNPyf4BiAIIInQU7MAjBcbMVw1yFsAutCOw2+xDS2bzz7yCAQIsywcgOROwQ+iVV IdqieoPd5gEZtX90B7uN3CCTmCKwDZSVQP8wxoT31xC3M78//wGPMNHQ