  We present a two-dimensional (2-D) fitting algorithm (GALFIT, Version 3) with
new capabilities to study the structural components of galaxies and other
astronomical objects in digital images. Our technique improves on previous 2-D
fitting algorithms by allowing for irregular, curved, logarithmic and power-law
spirals, ring and truncated shapes in otherwise traditional parametric
functions like the Sersic, Moffat, King, Ferrer, etc., profiles. One can mix
and match these new shape features freely, with or without constraints, apply
them to an arbitrary number of model components and of numerous profile types,
so as to produce realistic-looking galaxy model images. Yet, despite the
potential for extreme complexity, the meaning of the key parameters like the
Sersic index, effective radius or luminosity remain intuitive and essentially
unchanged. The new features have an interesting potential for use to quantify
the degree of asymmetry of galaxies, to quantify low surface brightness tidal
features beneath and beyond luminous galaxies, to allow more realistic
decompositions of galaxy subcomponents in the presence of strong rings and
spiral arms, and to enable ways to gauge the uncertainties when decomposing
galaxy subcomponents. We illustrate these new features by way of several case
studies that display various levels of complexity.
