img = toimage(image_data.reshape((8,8))) // Data was a flat row of 64 "pixels".
img.save(output, format="PNG")
contents = output.getvalue()
tooltip_s.append( <img src="data:image/png;base64,%s"> %base64.b64encode(contents).replace("\n","") )
output.close()
tooltip_s = km.np.array(tooltip_s) // need to make sure to feed it as a NumPy array, not a list
After Change
img = toimage(image_data.reshape((8,8))) // Data was a flat row of 64 "pixels".
img.save(output, format="PNG")
contents = output.getvalue()
img_encoded = base64.b64encode(contents)
img_tag = <img src="data:image/png;base64,{}"> .format(img_encoded.decode("utf-8"))
tooltip_s.append(img_tag)
output.close()