Various algorithms for segmentation of 2D and 3D images, such as computed tomography and satellite remote sensing. The R package bayesImageS implements Bayesian image analysis using the hidden Potts model with external field prior. Latent labels are sampled using chequerboard updating or Swendsen-Wang. Algorithms for the smoothing parameter include pseudolikelihood, path sampling, the exchange algorithm, and approximate Bayesian computation.