Hello,<div><br class="webkit-block-placeholder"></div><div>This is my first post. I want to write a simply app layering several images each with different weighting. This problem is pixel manipulation by QImage appears to be quite slow. My code is:</div>
<div><br class="webkit-block-placeholder"></div><div><div> w = image.width()</div><div> h = image.height()</div><div> </div><div> for j in range(h):</div><div> for i in range(w):</div>
<div> col = QtGui.QColor(image.pixel(i, j))</div><div> </div><div> col.setRed(col.red()*self.fKd)</div><div> image.setPixel(i, j, col.rgb());</div><div> </div>
<div> </div><div><br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>painter.drawImage(0, 0, image)</div><div><br class="webkit-block-placeholder"></div>
<div>Just one image changed in red channel. It took about 5 seconds to redraw a 1280 X 720 image any time I changed Kd. Far from interactive. I'd like to know is there any way to do stuff like that faster? Or calculating a million pixels in PyQt is just a bad idea? Any advice should be appreciated.</div>
<div><br class="webkit-block-placeholder"></div><div>Thanks,</div><div><br class="webkit-block-placeholder"></div><div>zhang</div></div>