The reconstruction of certain types of binary images from their projections is a frequently studied problem in combinatorial image processing. hv-convex images with fixed projections play an important role in discrete tomography. In this paper, we provide a fast polynomialtime algorithm for reconstructing canonical hv-convex images with given number of 4-connected components and with minimal number of columns satisfying a prescribed horizontal projection. We show that the method gives a solution that is always 8-connected. We also explain how the algorithm can be modified to obtain solutions with any given number of columns, and also with non-connected components.