use binary encoding for image