bitmap and bytes conversion