Skip to content

Instantly share code, notes, and snippets.

View fepegar's full-sized avatar

Fernando Pérez-García fepegar

View GitHub Profile
@fepegar
fepegar / toQImage.py
Last active June 22, 2017 19:11 — forked from smex/toQImage.py
Convert numpy arrays to QImage
from PyQt4.QtGui import QImage, qRgb
import numpy as np
class NotImplementedException:
pass
gray_color_table = [qRgb(i, i, i) for i in range(256)]
def toQImage(im, copy=False):
if im is None: