getsf extracts sources and filaments in astronomical images by separating their structural components, and is designed to handle multi-wavelength sets of images and very complex filamentary backgrounds. The method spatially decomposes the original images and separates the structural components of sources and filaments from each other and from their backgrounds, flattening their resulting images. It spatially decomposes the flattened components, combines them over wavelengths, and detects the positions of sources and skeletons of filaments. Finally, getsf measures the detected sources and filaments and creates the output catalogs and images. This universal and fully automated method has a single user-definable free parameter, which reduces to a minimum dependence of its results on the human factor.