Adaptive coding/decoding methods for narrow-band direct-printing equipment