(self)
Creates an image by combining the contents of the three screens
            to present a page preview.
            The image associated with each screen is separated into cyan,
            magenta, and yellow components. We add up the values for each
            component from the three screen images, and subtract the totals
            from the maximum value for each corresponding primary color.
Creates an image by combining the contents of the three screens
            to present a page preview.
            The image associated with each screen is separated into cyan,
            magenta, and yellow components. We add up the values for each
            component from the three screen images, and subtract the totals
            from the maximum value for each corresponding primary color.
Creates an image by combining the contents of the three screens to present a page preview . The image associated with each screen is separated into cyan magenta and yellow components . We add up the values for each component from the three screen images and subtract the totals from the maximum value for each corresponding primary color .
def createImage(self):
        """ Creates an image by combining the contents of the three screens
            to present a page preview.
            The image associated with each screen is separated into cyan,
            magenta, and yellow components. We add up the values for each
            component from the three screen images, and subtract the totals
            from the maximum value for each corresponding primary color.
        """
        newImage = self.scaledImage.copy()

        image1 = self.cyanWidget.image()
        image2 = self.magentaWidget.image()
        image3 = self.yellowWidget.image()
        darkness = 255 - self.brightness

        for y in range(newImage.height()):
            for x in range(newImage.width()):
                # Create three screens, using the quantities of the source CMY
                # components to determine how much of each of the inks are to
                # be put on each screen.
                p1 = image1.pixel(x, y)
                cyan1 = float(255 - qRed(p1))
                magenta1 = float(255 - qGreen(p1))
                yellow1 = float(255 - qBlue(p1))

                p2 = image2.pixel(x, y)
                cyan2 = float(255 - qRed(p2))
                magenta2 = float(255 - qGreen(p2))
                yellow2 = float(255 - qBlue(p2))

                p3 = image3.pixel(x, y)
                cyan3 = float(255 - qRed(p3))
                magenta3 = float(255 - qGreen(p3))
                yellow3 = float(255 - qBlue(p3))

                newColor = QColor(
                    max(255 - int(cyan1 + cyan2 + cyan3) - darkness, 0),
                    max(255 - int(magenta1 + magenta2 + magenta3) - darkness, 0),
                    max(255 - int(yellow1 + yellow2 + yellow3) - darkness, 0))

                newImage.setPixel(x, y, newColor.rgb())

        self.finalWidget.setPixmap(QPixmap.fromImage(newImage))
def createImage ( self ) : newImage = self . scaledImage . copy ( ) image1 = self . cyanWidget . image ( ) image2 = self . magentaWidget . image ( ) image3 = self . yellowWidget . image ( ) darkness = 255 - self . brightness for y in range ( newImage . height ( ) ) : for x in range ( newImage . width ( ) ) : # Create three screens, using the quantities of the source CMY # components to determine how much of each of the inks are to # be put on each screen. p1 = image1 . pixel ( x , y ) cyan1 = float ( 255 - qRed ( p1 ) ) magenta1 = float ( 255 - qGreen ( p1 ) ) yellow1 = float ( 255 - qBlue ( p1 ) ) p2 = image2 . pixel ( x , y ) cyan2 = float ( 255 - qRed ( p2 ) ) magenta2 = float ( 255 - qGreen ( p2 ) ) yellow2 = float ( 255 - qBlue ( p2 ) ) p3 = image3 . pixel ( x , y ) cyan3 = float ( 255 - qRed ( p3 ) ) magenta3 = float ( 255 - qGreen ( p3 ) ) yellow3 = float ( 255 - qBlue ( p3 ) ) newColor = QColor ( max ( 255 - int ( cyan1 + cyan2 + cyan3 ) - darkness , 0 ) , max ( 255 - int ( magenta1 + magenta2 + magenta3 ) - darkness , 0 ) , max ( 255 - int ( yellow1 + yellow2 + yellow3 ) - darkness , 0 ) ) newImage . setPixel ( x , y , newColor . rgb ( ) ) self . finalWidget . setPixmap ( QPixmap . fromImage ( newImage ) )