implement masking and add transparent background