In image processing (e.g., in astronomy), the desired black-and-white
image is, from the mathematical viewpoint, a set. Hence, to process im
ages, we need to process sets. To define a generic set, we need infini
tely many parameters; therefore, if we want to represent and process s
ets in the computer, we must restrict ourselves to finite-parameter fa
milies of sets that will be used to approximate the desired sets. The
wrong choice of a family can lead to longer computations and worse app
roximation. Hence, it is desirable to find the family that it is the b
est in some reasonable sense. In this paper, we show how the problems
of choosing the optimal family of sets can be formalized and solved. A
s a result of the described general methodology, for astronomical imag
es, we get exactly the geometric shapes that have been empirically use
d by astronomers and astrophysicists; thus, we have a theoretical expl
anation for these shapes.