better handling of two-tone images