In this study we evaluate the performance of several lossless grayscale image compression algorithms: algorithms that are standards in medical image transmitting and archiving systems, other algorithms used for compressing medical images in practice and in image compression research, and of a couple of universal algorithms applied to raw and preprocessed image data. In the experiments we use a new, publicly available, test image set, which is described in detail in the paper. The set contains about one hundred images, mainly medical images of various modalities (CR, CT, MR, and US) and natural continuous tone grayscale images of various sizes and various bit depths (up to 16 bits per pixel). We analyze algorithm performance with respect to image modality, depth, and size. Our results generally adhere to results reported in other studies, however, we find that some common opinions on performance of popular algorithms are imprecise, or even false. Most interesting observation concerning the compression speed is that the speed of many algorithms is relatively low, e.g., JPEG2000 obtains speed close to CALIC algorithm, which is considered to be slow. On the other hand there exist algorithms much faster than the JPEG-LS (i.e., SZIP and SFALIC). Considering the compression ratio, the most interesting results were obtained for high bit depth medical CT and MR images, which are of sparse histograms. For better compression ratios of those images, instead of standard image compression algorithms, we should either use universal algorithms or employ the histogram packing technique prior to actual image compression.