Most demosaicing algorithms today are based on first reconstructing the green (G) color component followed by the reconstruction of the red (R) and the blue (B) components using the green. This approach and associated methods of using the differences R-G and B-G are arbitrary and in most cases not optimal. Instead, we propose optimal color spaces for demosaicing. Our optimization is based on energy compactness and smoothness of the color components. We compare the performance of the proposed algorithms to presently available demosaicing methods and show that the new approaches are superior both visually and quantitatively. Our conclusion is that the new color spaces improve the performance of demosaicing algorithms.