My answer won't be code based, cause I don't know how to directly display a CMYK image. But I know that to convert an CMYK image to RGB values you just do the following


CMY2RGB:
--> RED = 1-C
--> GREEN = 1-M
--> BLUE = 1-Y ,


since the RGB ans CMY color spaces are complements. Before doing that though, you have to convert CMYK to CMY by adding the "black" (K) value to the CMY values. The black value is the minimum of the other 3 values:


CMYK2CMY
Cyan = minimum(1,Cyan*(1-Black)+Black)
Magenta = minimum(1,Magenta*(1-Black)+Black)
Yellow = minimum(1,Yellow*(1-Black)+Black)


Hope this helps.