writing image processsing pipeline