I present a software tool for solving the astrometry of astronomical images. The code puts emphasis on robustness against failures for correctly matching the sources in the image to a reference catalog, and on the stability of the solutions over the field of view (e.g., using orthogonal polynomials for the fitted transformation). The code was tested on over 50,000 images from various sources, including the Palomar Transient Factory (PTF) and the Zwicky Transient Facility (ZTF). The tested images equally represent low and high Galactic latitude fields and exhibit failure/bad-solution rate of <2x10^-5. Running on PTF 60-s integration images, and using the GAIA-DR2 as a reference catalog, the typical two-axes-combined astrometric root-mean square (RMS) is 14 mas at the bright end, presumably due to astrometric scintillation noise and systematic errors. I discuss the effects of seeing, airmass and the order of the transformation on the astrometric accuracy. The software, available online, is developed in MATLAB as part of an astronomical image processing environment and it can be run also as a stand-alone code.