Colloidal gold is a useful marker for functional-imaging experiments in transmission X-ray microscopy. Due to the low contrast of gold particles with small diameters it is necessary to develop a powerful algorithm to localize the single gold particles. The presented image-analysis algorithm for identifying colloidal gold particles is based on the combination of a threshold with respect to the local absorption and shape discrimination, realized by fitting a Gaussian profile to the identified regions of interest. The shape discrimination provides the possibility of size-selective identification and localization of single colloidal gold particles down to a diameter of 50 nm. The image-analysis algorithm, therefore, has potential for localization studies of several proteins simultaneously and for localization of fiducial markers in X-ray tomography.