  Context. An automatic tool to derive structural parameters of semi-resolved
star clusters located in crowded stellar fields in nearby galaxies is needed
for homogeneous processing of archival frames.
  Aims. We have developed a program that automatically derives the structural
parameters of star clusters and estimates errors by accounting for individual
stars and variable sky background.
  Methods. Models of observed frames consist of the cluster's surface
brightness distribution, convolved with a point spread function; the stars,
represented by the same point spread function; and a smoothly variable sky
background. The cluster's model is fitted within a large radius by using the
Levenberg-Marquardt and Markov chain Monte Carlo algorithms to derive
structural parameters, the flux of the cluster, and individual fluxes of all
well-resolved stars.
  Results. FitClust, a program to derive structural parameters of semi-resolved
clusters in crowded stellar fields, was developed and is available for free
use. The program was tested on simulated cluster frames, and was used to
measure clusters of the M31 galaxy in Subaru Suprime-Cam frames.
  Conclusions. Accounting for bright resolved stars and variable sky background
significantly improves the accuracy of derived structural parameters of star
clusters. However, their uncertainty remains dominated by the stochastic noise
of unresolved stars.
