이

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,575
jQuery 11-12-17 조회 3,315
MySQL 11-12-17 조회 3,601
MySQL 11-12-17 조회 2,941
node.js 11-12-16 조회 2,549
node.js 11-12-15 조회 2,861
node.js
[node.js]
11-12-15 조회 2,998
node.js 11-12-15 조회 5,728
JavaScript 11-12-15 조회 3,115
Linux 11-12-14 조회 1,959
PHP 11-12-14 조회 4,218
jQuery 11-12-12 조회 2,704
Linux 11-12-12 조회 2,792
node.js 11-12-09 조회 3,099
Mobile 11-12-09 조회 3,586
Mobile 11-12-09 조회 2,934
Mobile 11-12-09 조회 3,383
Mobile 11-12-09 조회 4,489
node.js 11-12-09 조회 2,364
기타 11-12-09 조회 3,118
Flash 11-12-08 조회 2,746
PHP 11-12-08 조회 2,807
jQuery 11-12-08 조회 1.2만
PHP 11-12-08 조회 4,468
jQuery 11-12-08 조회 3,042
JavaScript 11-12-08 조회 3,061
node.js 11-12-07 조회 2,465
jQuery 11-12-07 조회 3,381
Flash 11-12-07 조회 3,836
node.js 11-12-07 조회 3,478