Error in generating colored cmy qr image
Question: I have to generate 3 QR images with background color cyan, magenta and yellow
and merge them to generate CMY colored QR as shown in image 1. Now after
generating images, to merge them by using cv2.merge,converting these into gray
image and then merging operation gives me image 2 instead of image 1 (Ignore
the color of finder patterns) I am using Python 2.7, Open CV 3.0. Unable to
figure out what I am doing wrong. Please help me to get out of this. Thanks in
advance.

[![Snapshot1](http://i.stack.imgur.com/Ju9WV.png)](http://i.stack.imgur.com/Ju9WV.png)

[![Snapshot2](http://i.stack.imgur.com/eeXEJ.png)](http://i.stack.imgur.com/eeXEJ.png)

Code I am using is given below:

    
    
    import pyqrcode
    import cv2
    bigcode = pyqrcode.create('When I say it is you', error='L', version=2,mode='binary')
    bigcode.png('new1.png', scale=6, module_color=[0, 0, 0], background = [0xff,0xff,0])
    bigcode1 = pyqrcode.create('peace that triumphant over war ', error='L', version=2, mode='binary')
    bigcode1.png('new2.png', scale=6, module_color=[0, 0, 0], background = [0xff,0,0xff])
    bigcode2 = pyqrcode.create('Love that conquers hate ', error='L', version=2, mode='binary')
    bigcode2.png('new3.png', scale=6, module_color=[0, 0, 0], background = [0,0xff,0xff])
    bigcode.show()
    b = bigcode1.show()
    c = bigcode2.show()
    img1 = cv2.imread('C:/New folder (2)/new1.png')
    img2 = cv2.imread('C:/New folder (2)/new2.png')
    img3 = cv2.imread('C:/New folder (2)/new3.png')
    gray_img1 = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY)
    cv2.imshow('k1',gray_img1)         
    gray_img2 = cv2.cvtColor(img2, cv2.COLOR_BGR2GRAY)
    
    gray_img3 = cv2.cvtColor(img3, cv2.COLOR_BGR2GRAY)
    
    k = cv2.merge([gray_img1,gray_img2,gray_img3])
    
    cv2.imshow('k',k)
    cv2.imwrite('k.png',k)
    
    cv2.waitKey(0)
    


Answer: Instead of generating c,m,y,k colored QR, try to convert rgb in cmyk
colorspace. this would help in generating correct result.

