이

php로 이미지 흑백효과

이미지를 흑백으로 만들고 싶을때 사용합니다 php5의 imagefilter 기능을 써봅니다
 
<?
$image = imagecreatefromjpeg('2.jpg'); //흑백으로 만들 원본이미지
imagefilter($image, IMG_FILTER_GRAYSCALE);
imagejpeg($image, 'grayscale-2.jpg'); //흑백으로 만들어질 생성이미지
imagedestroy($image);
echo '<img src="grayscale-2.jpg" alt="Image With A Grayscale Effect Applied" />'; //확인
?>
 

댓글 3개

혹시 흑백말고 컬러톤 변경되는 방법은 없을까요? 꼭 필요한데 ㅠㅠ
무슨 내용인지 알고 싶군여 ㅠ
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

5,403건

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
Mobile 11-12-19 조회 4,582
jQuery 11-12-17 조회 3,323
MySQL 11-12-17 조회 3,609
MySQL 11-12-17 조회 2,949
node.js 11-12-16 조회 2,557
node.js 11-12-15 조회 2,867
node.js
[node.js]
11-12-15 조회 3,005
node.js 11-12-15 조회 5,741
JavaScript 11-12-15 조회 3,125
Linux 11-12-14 조회 1,967
PHP 11-12-14 조회 4,226
jQuery 11-12-12 조회 2,712
Linux 11-12-12 조회 2,798
node.js 11-12-09 조회 3,105
Mobile 11-12-09 조회 3,592
Mobile 11-12-09 조회 2,941
Mobile 11-12-09 조회 3,388
Mobile 11-12-09 조회 4,497
node.js 11-12-09 조회 2,375
기타 11-12-09 조회 3,128
Flash 11-12-08 조회 2,758
PHP 11-12-08 조회 2,817
jQuery 11-12-08 조회 1.2만
PHP 11-12-08 조회 4,476
jQuery 11-12-08 조회 3,049
JavaScript 11-12-08 조회 3,070
node.js 11-12-07 조회 2,476
jQuery 11-12-07 조회 3,384
Flash 11-12-07 조회 3,845
node.js 11-12-07 조회 3,487