optimization method generate of watermark