알

이미지에 워터마크 추가하기

· 2021-11-23 (화) 20:01:43 · 6010 · 4

<?php

    // Load the stamp and the photo to apply the watermark to

    $stamp = imagecreatefrompng('text.png');

    $im = imagecreatefrompng('original.png');

    

    // Set the margins for the stamp and get the height/width of the stamp image

    $marge_right = 10;

    $marge_bottom = 10;

    $sx = imagesx($stamp);

    $sy = imagesy($stamp);

    

    // Copy the stamp image onto our photo using the margin offsets and the photo 

    // width to calculate positioning of the stamp. 

    imagecopy($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp));

    

    // Output and free memory

    header('Content-type: image/png');

    imagepng($im);

    imagedestroy($im);

?>

 

    $stamp = imagecreatefrompng('text.png');

    $im = imagecreatefrompng('original.png');

오리지날 이미지와 text.png 이미지가 겹쳐져 워터마크 기능이 됩니다.

 

 

 

|

댓글 4개

2021-11-26 (금) 09:39:49
좋은 정보 감사합니다.
2021-11-26 (금) 23:46:43
팁을 알려주시려면 적용방법등 자세히 알려주시면 감사하겠습니다~
저러케 만 적어주시면..........
초보분들에게는 적용에 무리가 있다고 보여집니다....
자세한 설명을 부탁드릴 수 있을까요...? ㅠ.ㅠ
적용방법이 설명이 없어서
저같은 초보한테는
보고도 못먹는 그림의 떡이네요 ㅠㅠ
댓글을 작성하시려면 로그인이 필요합니다.

그누보드5 팁자료실

2,788건
+
제목 글쓴이 날짜 조회
22-01-07 조회 4,801
22-01-07 조회 4,750
22-01-04 조회 5,266
22-01-03 조회 6,878
21-12-30 조회 5,373
21-12-30 조회 5,845
21-12-26 조회 6,363
21-12-19 조회 5,531
21-12-18 조회 5,783
21-12-17 조회 4,926
21-12-14 조회 5,432
21-12-10 조회 9,513
21-12-10 조회 5,183
21-12-08 조회 9,160
21-12-08 조회 1.1만
21-12-07 조회 6,150
21-12-04 조회 6,465
21-12-04 조회 5,111
21-12-03 조회 5,814
21-12-02 조회 5,201
21-12-02 조회 5,663
21-12-02 조회 5,419
21-12-02 조회 4,925
21-11-30 조회 5,967
21-11-23 조회 6,011
21-11-23 조회 5,138
21-11-23 조회 6,656
21-11-23 조회 5,641
21-11-23 조회 4,812
21-11-22 조회 5,777