Position based on the color order of the image.
Read () {if ($ file! = '.' & $ File! = '.. ') {If (is_dir ($ to_dir. '/'. $ file) {mkdir ($ output_dir. '/'. $ file); add_wm_recurse ($ nmw_water, $ to_dir. '/'. $ file, $ output_dir. '/'. $ file, $ arr);} else {if (! Array_key_exists ($ to_dir. '/'. $ file, $ arr) {continue;} $ sub_arr = $ arr [$ to_dir. '/'. $ file]; if ($ sub_arr) {$ x = intval ($ sub_arr [0]); $ y = intval ($ sub_arr [1]); add_wm ($ nmw_water, $ to_dir. '/'. $ file, $ output_dir. '/'. $ file, $ x, $ y) ;}}}$ dp-> close () ;}$ to_dir = '. /resized '; $ output_dir = '. /output'; // This is the coordinate array (posX, posY) $ arr = array (50, 5 0); $ water = '. /water.png '; $ nmw_water = NewMagickWand (); MagickReadImage ($ nmw_water, $ water); add_wm_recurse ($ nmw_water, $ to_dir, $ output_dir, $ arr ); destroyMagickWand ($ nmw_water);?>