Not entirely sure what you mean, but I'm guessing that you have a picture with X by Y pixels and you know the colour of each one. What you are trying to do is increase the number of pixels. The colour of the extra pixels depend on the ones around it.
This is similar to the concept behind a JPEG so try looking up the implementation defined by that specification.