2026, 새로운 도약을 시작합니다.

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

<?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개

좋은 정보 감사합니다.
팁을 알려주시려면 적용방법등 자세히 알려주시면 감사하겠습니다~
저러케 만 적어주시면..........
초보분들에게는 적용에 무리가 있다고 보여집니다....
자세한 설명을 부탁드릴 수 있을까요...? ㅠ.ㅠ
적용방법이 설명이 없어서
저같은 초보한테는
보고도 못먹는 그림의 떡이네요 ㅠㅠ

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

그누보드5 팁자료실

번호 제목 글쓴이 날짜 조회
공지 3년 전 조회 4,596
2741 2일 전 조회 86
2740 3일 전 조회 89
2739 1주 전 조회 200
2738 1주 전 조회 206
2737 1주 전 조회 171
2736 1주 전 조회 274
2735 3주 전 조회 276
2734 3주 전 조회 256
2733 1개월 전 조회 261
2732 1개월 전 조회 297
2731 1개월 전 조회 263
2730 1개월 전 조회 220
2729 1개월 전 조회 349
2728 1개월 전 조회 241
2727 1개월 전 조회 417
2726 1개월 전 조회 250
2725 1개월 전 조회 325
2724 1개월 전 조회 355
2723 1개월 전 조회 263
2722 1개월 전 조회 296
2721 1개월 전 조회 208
2720 2개월 전 조회 301
2719 2개월 전 조회 304
2718 2개월 전 조회 197
2717 2개월 전 조회 333
2716 2개월 전 조회 200
2715 2개월 전 조회 308
2714 2개월 전 조회 269
2713 2개월 전 조회 370
2712 2개월 전 조회 285
🐛 버그신고