PyQt - Display QImage red channel only
<p>I'm working on a Picture Viewer and I want to be able to quickly visualize the red, green and blue channels separately.</p>

<p>Right now this is the working code I have but it's really slow since it's going through each pixel individually.</p>

<pre><code>self.image = QtGui.QGraphicsPixmapItem()
image = QtGui.QImage("C:/Users/Thibault/Desktop/title.png")
image = image.convertToFormat(QtGui.QImage.Format_ARGB32)
for y in xrange(image.height()):
    for x in xrange(image.width()):
        c = QtGui.QColor()
        c.setRgb(image.pixel(x, y))
        image.setPixel(x, y, QtGui.QColor(c.red(), c.red(), c.red()).rgba())

pixmap = QtGui.QPixmap.fromImage(image)
self.image.setPixmap(pixmap)
</code></pre>

<p>Is there any other (faster) way to do this kind of thing?</p>