본문 바로가기

컴터/php

[펌]php 썸네일 클래스 - hash

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.


phpThumb_1.7.9.zip

출처 : http://phpthumb.sourceforge.net/demo/demo/phpThumb.demo.demo.php

* 예시중 X|Y|A 이런식은 fltr[]=X|Y|A 로 filter로 파라미터 해줌.



예시 :

예 : http://~~~./phpThumb.php?src=up_file/h.jpg&q=100&w=200&h=200&fltr[]=wmi|wm/wm.png|BL&sia=aaaa&f=gif&bg=000000

src= 만들 이미지 (h.jpg)
q= 품질(0~100)
w= 넓이
h= 높이 ->내생각 : 같은 비율로 큰 쪽을 기준으로 줄어드는듯.. 그러니 한쪽만 해주는것이 좋겠다.

fltr[]=
wmi|wm/wm.png|BL 워터마크 씌울 파일  => BL 은 bottom + left , * 는 모든 곳에 찍는다 정가운데 C 하나만 한다.
fltr[]= stc|FFFFFF|5|10 : transparency
fltr[]=usm|80|0.5|3 : unsharp
fltr[]=blur|5 : blur
fltr[]=sblr : gaussian blur
fltr[]=bord|1 : border (bord|1|0|0|FE5207 : 보더|굵기|상|하둥글이|색)
fltr[]=mask|images/mask05.png : mask
fltr[]=wmt|phpThumb|18|C|FF0000|loki.ttf|100|5|20 : 문자쓰기
-> 예제 : <img src="http://matda.co.kr/class/thumb/phpThumb.php?src=wm/blank.png&q=100&w=500&h=70&fltr[]=wmt|안 녕|18|C|000000|hline.ttf|80|0|0&iar=1&sia=<?=urlencode('안녕')?>" />
* fltr[]=wmt|안 녕|18|C|000000|hline.ttf|80|0|0 : fltr[]=wmt|쓸문자|폰트크기|위치|색깔|폰트종류|opacity|모름ㅋ|로테이트
* + : 띄워쓰기(그냥 스페이바해도됨)
* %0A : 줄바꿈
-> 폰트는 리눅스의경우 /etc/share/korea/TrueType/안에것
fonts/안에 복사에 놓음
-> 익스에서만 폰트가 제대로 안나올 경우 urlencode('안녕') 해볼것.
->필터 2개 줄때 : fltr[]=wmi|wm/wm.png|BL&fltr[]=blur|5 ........


ar=l : (auto rotate) L 또는 l -> 넓은쪽(landscape), P 또는 p -> 좁은쪽기준(potrait), x -> EXIF 기준으로 자동 rotate 시킴
ra=30 : (ratio aspect?) 30도 로테이트 시킴

iar=1 : 가로 세로 비율 상관없이 억지로 늘리거나 줄임
zc=1 : zoom-crop (가운데를 기점으로 설정된 넓이 높이 만큼 잘라내는 듯)
aoe=1 : 작은거 늘려서 출력(AllowOutputEnlargement enabled)
w=250&sx=60&sy=5&sw=100&sh=100 : 원본 250px 넓이의 이미지를 x축 60, y축5px 부터 100X100px로 잘라내라 far=T : (Fource Aspect Ratio) Top 기준으로 강제 비율로 줄임(맞춤) (C-Cent,T-Top,B-Bottom,L-Left,R-Right)


crop|0|0|0|0.25 : crop filter (zc=1 과의 차이를 모르겠네..;;)
bord|2|20|10|009900 : 라운딩 보더 (2px border | 가로둥근 정도 | 세로둥근정도 | 모름;;)
ric|50|20 : 이미지를 둥글게 잘라내어 썸네일 (가로 둥금, 세로 둥금)
sat|-100 : 흑백 (0~-100%)



sia= 다운로드 받을 파일명
f= 생성 포맷(gif, jpg, png, ico)
bg= 백그라운드 (000000)


hash=Math.random(), hash=rand()
-> 캐시(cache)에 남아 이전 사진을 계속 보여줄때 이렇게 처리했음. phpthumb은 허용된 parameter만 받아들이기에 hash로 이용함 ㅡㅡㅋ (handler.js)


wmi|images/watermark.png|75x50|80|75|75|45 -> 이런옵션도 있음 (wmi|워터마크|x,y좌표|opacity|scale_x|scale_y|rotation)

글쓰기
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=wmt|phpThumb|18|C|FF0000|loki.ttf|100|5|20&f=png" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=wmt|%26%239786%3B%26%239835%3B%26%230470%3B%26%231694%3B|40|L|FF0000|arial.ttf|100&f=png" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=wmt|copyright+2009|3|BR|00FF00||50&f=png" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=wmt|copyright+2009%0AphpThumb()|3|L|00FFFF&f=png" alt="">


결과물 :

aaaa 라는 파일명으로 다운



phpThumb.demo.showpic.php demo here
Difference between GD1 and GD2

The following images have the textured background behind them to illustrate transparency effects. Note that some browsers, notably Internet Explorer, are incapable of displaying alpha-channel PNGs. See my page on the PNG transparency problem. Other modern browsers such as Mozilla/Firefox display alpha-transparent PNGs with no problems.

#0
<img src="../phpThumb.php" alt="">
phpThumb version



#1
<img src="../phpThumb.php?src=images/disk.jpg&w=200" alt="">
width=200px



#2
<img src="../phpThumb.php?src=images/disk.jpg&w=200&q=10&sia=custom-filename" alt="">
width=200px, JPEGquality=10%, SaveImageAs=custom-filename



#3
<img src="../phpThumb.php?src=images/watermark.png&w=400&aoe=1&bg=ffffff" alt="">
width=400px, AllowOutputEnlargement enabled



#4
<img src="../phpThumb.php?src=images/disk.jpg&w=250&sx=600&sy=5&sw=100&sh=100&aoe=1" alt="">
section from (600x5 - 700x105) cropped and enlarged by 250%, AllowOutputEnlargement enabled



#5
<img src="../phpThumb.php?src=http%3A%2F%2Fsilisoftware.com%2Fimages%2FSiliSoft.gif&w=100" alt="">
HTTP source image
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#6
<img src="../phpThumb.php?src=images/disk.jpg&w=200&fltr[]=wmi|images/watermark.png|BL" alt="">
width=200px, watermark (bottom-left, 75% opacity)
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#7
<img src="../phpThumb.php?src=images/disk.jpg&w=200&fltr[]=wmi|images/watermark.png|*|25" alt="">
width=200px, watermark (tiled, 25% opacity)
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#8
<img src="../phpThumb.php?src=images/disk.jpg&w=200&fltr[]=wmi|images/watermark.png|75x50|80|75|75|45" alt="">
width=200px, watermark (absolute position (75x50), rotation (45), scaling (75x75)))
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#9
<img src="../phpThumb.php?src=images/watermark.png&bg=00FFFF&f=png" alt="">
<img src="../phpThumb.php?src=images/watermark.png&bg=00FFFF&f=gif" alt="">
<img src="../phpThumb.php?src=images/watermark.png&bg=00FFFF&f=jpeg" alt="">
source image (GIF) transpancy with transparent output (PNG, GIF) vs. specified background color (JPEG)



#10
<img src="../phpThumb.php?src=images/animaple.gif" alt="">
<img src="../phpThumb.php?src=images/animaple.gif&w=25&f=gif" alt="">
<img src="../phpThumb.php?src=images/animaple.gif&w=25&f=png" alt="">
<img src="../phpThumb.php?src=images/animaple.gif&w=25&f=ico" alt="">
<img src="../phpThumb.php?src=images/animaple.gif&w=25&f=bmp" alt="">
<img src="../phpThumb.php?src=images/animaple.gif&w=25&f=jpeg" alt="">
resize animated GIF. Notice how output format affects the result: GIF is animated and transparent; PNG and ICO are tranparent but not animated (first frame is rendered as a still image); JPEG and BMP are neither transparent nor animated. Any filters will disable animated resizing (may be fixed in a future version).

(requires ImageMagick, this server is running "6.2.8 04/17/08 Q16" so it will work)



#11
<img src="../phpThumb.php?src=images/animaple.gif" alt="">
<img src="../phpThumb.php?src=images/animaple.gif&sfn=0&f=png" alt="">
<img src="../phpThumb.php?src=images/animaple.gif&sfn=2&f=png" alt="">
Specifying still-image source frame in multi-frame source images

(requires ImageMagick, this server is running "6.2.8 04/17/08 Q16" so it will work)



#12
<img src="../phpThumb.php?src=images/alpha.png&f=png" alt="">
<img src="../phpThumb.php?src=images/alpha.png&f=ico" alt="">
<img src="../phpThumb.php?src=images/alpha.png&f=gif" alt="">
<img src="../phpThumb.php?src=images/alpha.png&f=jpeg" alt="">
PNG alpha transparency test, using test image from the PNG transparency test page
(only works with PHP v4.3.2+, this server is running PHP v5.2.8 so it will work (correctly))



#13
<img src="../phpThumb.php?src=images/disk.jpg&w=200&fltr[]=stc|FFFFFF|5|10&f=png" alt="">
Create transparency from source image color
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#14
<img src="../phpThumb.php?src=images/loco.jpg&w=200" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=usm|80|0.5|3" alt="">
normal vs. unsharp masking at default settings
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#15
<img src="../phpThumb.php?src=images/loco.jpg&w=200" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=blur|1" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=blur|5" alt="">
normal vs. blur at default (1) and heavy (5)
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#16
<img src="../phpThumb.php?src=images/loco.jpg&w=200" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=gblr" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=sblr" alt="">
normal vs. gaussian blur vs. selective blur
(only works with PHP v5.0.0+, this server is running PHP v5.2.8 so it will work (correctly))
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#17
<img src="../phpThumb.php?src=images/pineapple.jpg&w=100&h=100&far=L&bg=0000FF&f=png&fltr[]=bord|1" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=100&h=100&far=T&bg=FF0000&f=png&fltr[]=bord|1" alt="">
<img src="../phpThumb.php?src=images/pineapple.jpg&w=100&h=100&far=C&bg=0000FF&f=png&fltr[]=bord|1" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=100&h=100&far=B&bg=FF0000&f=png&fltr[]=bord|1" alt="">
<img src="../phpThumb.php?src=images/pineapple.jpg&w=100&h=100&far=R&bg=0000FF&f=png&fltr[]=bord|1" alt="">
Forced Aspect Ratio, colored background, PNG output
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#18
<img src="../phpThumb.php?src=images/pineapple.jpg&w=150&ar=L" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=150&ar=L" alt="">
auto-rotate counter-clockwise to landscape from portrait & lanscape
(only works with PHP v4.2.0+, this server is running PHP v5.2.8 so it will work)
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#19
<img src="../phpThumb.php?src=images/pineapple.jpg&hp=100&wl=200" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&hp=100&wl=200" alt="">
auto-selection of W and H based on source image orientation



#20
<img src="../phpThumb.php?src=images/monkey.jpg&w=150&h=150" alt="">
<img src="../phpThumb.php?src=images/monkey.jpg&w=150&h=150&ar=x" alt="">
original image vs. auto-rotated based on EXIF data
(only works with PHP v4.2.0+, this server is running PHP v5.2.8 so it will work)
(only works when the EXIF extension is loaded, so on this server it will work)
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#21
<img src="../phpThumb.php?src=images/loco.jpg&w=200&ra=30&bg=0000FF" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&ra=30&f=png" alt="">
<img src="../phpThumb.php?src=images/alpha.png&ra=30&f=png" alt="">
<img src="../phpThumb.php?src=images/alpha.png&ra=30&f=gif" alt="">
Rotated 30� (counter-clockwise), width=200px, blue background vs. transparent background vs. rotated image with pre-existing alpha
(only works with PHP v4.2.0+, this server is running PHP v5.2.8 so it will work)
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#22
<img src="../phpThumb.php?src=images/loco.jpg&w=200&h=300&far=1&bg=CCCCCC" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&h=300&iar=1" alt="">
Normal resize behavior (left) vs. Forced non-proportional resize (right)
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#23
<img src="../phpThumb.php?src=images/loco.jpg&w=100&h=50&zc=1" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=100&zc=1" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&h=50&zc=1" alt="">
<img src="../phpThumb.php?src=images/pineapple.jpg&w=100&h=50&zc=1" alt="">
<img src="../phpThumb.php?src=images/pineapple.jpg&w=100&zc=1" alt="">
<img src="../phpThumb.php?src=images/pineapple.jpg&h=50&zc=1" alt="">
Zoom-Crop



#24
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=crop|50" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=crop|0|0|0|0.25" alt="">
crop filter



#25
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=bord|2|20|10|009900&f=png" alt="">
2px border, curved border corners (20px horizontal radius, 10px vertical radius)
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#26
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=ric|50|20&f=png" alt="">
curved border corners (20px vertical radius, 50px horizontal radius)
Note: PNG/ICO output is 32-bit with alpha transparency, subject to PNG transparency problem in Internet Explorer
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)
(only works with PHP v4.3.2+, this server is running PHP v5.2.8 so it will work (correctly))



#27
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=sat|75" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=sat|-100" alt="">
saturation -75% vs. normal vs. -100%
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#28
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=ds|75" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=ds|-100" alt="">
desaturated 75% vs. normal vs. -100%
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#29
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=clr|25|00FF00" alt="">
colorized 25% to green (#00FF00)
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#30
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=gray" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=sep" alt="">
grayscale vs. sepia
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#31
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=mask|images/mask06.png&f=png" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=mask|images/mask04.png&f=png" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=mask|images/mask05.png&f=jpeg&bg=9900CC&q=100" alt="">
Assorted alpha masks (seen below) applied
Note: PNG/ICO output is 32-bit with alpha transparency, subject to PNG transparency problem in Internet Explorer
(only works with PHP v4.3.2+, this server is running PHP v5.2.8 so it will work (correctly))
JPEG/GIF output is flattened to "bg" background color
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)




#32
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=drop|5|10|000000|225&f=png" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=mask|images/mask06.png&fltr[]=drop|5|10|000000|225&f=png" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=drop|5|10|000000|225&fltr[]=elip&f=png" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=elip&fltr[]=drop|5|10|000000|225&f=png" alt="">
Drop shadow. Note how the order in which filters are applied matters.
(only works with PHP v4.3.2+, this server is running PHP v5.2.8 so it will work (correctly))
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#33
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=elip&f=png" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=elip&f=jpeg&bg=00FFFF" alt="">
Elipse
Note: PNG/ICO output is 32-bit with alpha transparency, subject to PNG transparency problem in Internet Explorer
(only works with PHP v4.3.2+, this server is running PHP v5.2.8 so it will work (correctly))
JPEG/GIF output is flattened to "bg" background color
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#34
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=flip|x" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=flip|y" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=flip|xy" alt="">
flipped on X, Y and X+Y axes
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#35
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=bvl|10|FFFFFF|000000" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=bvl|10|000000|FFFFFF" alt="">
10px bevel edge filter
(only works with PHP v4.3.2+, this server is running PHP v5.2.8 so it will work (correctly))
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#36
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=fram|3|2|CCCCCC|FFFFFF|000000" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=fram|3|2|CC9966|333333|CCCCCC" alt="">
3+2px frame filter
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#37
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=neg" alt="">
Negative filter (inverted color)
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#38
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=th|105" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=mask|images/mask04.png&fltr[]=th|105&f=png" alt="">
Threshold filter; showing preserved alpha channel
(only works with PHP v4.3.2+, this server is running PHP v5.2.8 so it will work (correctly))
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#39
<img src="../phpThumb.php?src=images/pineapple.jpg&w=150" alt="">
<img src="../phpThumb.php?src=images/pineapple.jpg&w=150&fltr[]=rcd|16|1" alt="">
<img src="../phpThumb.php?src=images/pineapple.jpg&w=150&fltr[]=rcd|16|0" alt="">
<img src="../phpThumb.php?src=images/pineapple.jpg&w=150&fltr[]=gray&fltr[]=rcd|8|1" alt="">
ReduceColorDepth filter; original vs. 16-color dither vs. 16-color nodither vs. 4-gray dither
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#40

<img src="../phpThumb.php?src=images/bunnies.jpg&w=150&fltr[]=hist|rgb||||BR|100&fltr[]=hist|*||||BL|100" alt="">
<img src="../phpThumb.php?src=images/bunnies.jpg&w=150&fltr[]=lvl|*|0&fltr[]=hist|rgb||||BR|100&fltr[]=hist|*||||BL|100" alt="">
<img src="../phpThumb.php?src=images/bunnies.jpg&w=150&fltr[]=lvl|*|1&fltr[]=hist|rgb||||BR|100&fltr[]=hist|*||||BL|100" alt="">
<img src="../phpThumb.php?src=images/bunnies.jpg&w=150&fltr[]=lvl|*|2&fltr[]=hist|rgb||||BR|100&fltr[]=hist|*||||BL|100" alt="">
<img src="../phpThumb.php?src=images/bunnies.jpg&w=150&fltr[]=lvl|*|3&fltr[]=hist|rgb||||BR|100&fltr[]=hist|*||||BL|100" alt="">

<img src="../phpThumb.php?src=images/lilies.jpg&w=150&fltr[]=hist|rgb||||BR|100&fltr[]=hist|*||||BL|100" alt="">
<img src="../phpThumb.php?src=images/lilies.jpg&w=150&fltr[]=lvl|*|0&fltr[]=hist|rgb||||BR|100&fltr[]=hist|*||||BL|100" alt="">
<img src="../phpThumb.php?src=images/lilies.jpg&w=150&fltr[]=lvl|*|1&fltr[]=hist|rgb||||BR|100&fltr[]=hist|*||||BL|100" alt="">
<img src="../phpThumb.php?src=images/lilies.jpg&w=150&fltr[]=lvl|*|2&fltr[]=hist|rgb||||BR|100&fltr[]=hist|*||||BL|100" alt="">
<img src="../phpThumb.php?src=images/lilies.jpg&w=150&fltr[]=lvl|*|3&fltr[]=hist|rgb||||BR|100&fltr[]=hist|*||||BL|100" alt="">
original vs. Levels filter methods (0=Internal RGB; 1=Internal Grayscale; 2=ImageMagick Contrast-Stretch; 3=ImageMagick Normalize)
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#41
<img src="../phpThumb.php?src=images/pineapple.jpg&w=200" alt="">
<img src="../phpThumb.php?src=images/pineapple.jpg&w=200&fltr[]=lvl" alt="">
<img src="../phpThumb.php?src=images/pineapple.jpg&w=200&fltr[]=wb" alt="">
original vs. Levels vs. White Balance
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#42
<img src="../phpThumb.php?src=images/loco.jpg&w=300&fltr[]=hist|rgb" alt="">
<img src="../phpThumb.php?src=images/bunnies.jpg&w=200&fltr[]=hist|*" alt="">
histograms of RGB vs. grayscale
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#43
<img src="../phpThumb.php?src=images/loco.jpg&w=300&fltr[]=edge" alt="">
Edge Detect filter
(only works with PHP v5.0.0+ or ImageMagick, this server is running PHP v5.2.8 and "6.2.8 04/17/08 Q16" so it will work (correctly))
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#44
<img src="../phpThumb.php?src=images/loco.jpg&w=300&fltr[]=emb" alt="">
Emboss filter
(only works with PHP v5.0.0+ or ImageMagick, this server is running PHP v5.2.8 and "6.2.8 04/17/08 Q16" so it will work (correctly))
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#45
<img src="../phpThumb.php?src=images/loco.jpg&w=300&fltr[]=mean" alt="">
Mean Removal filter
(only works with PHP v5.0.0+, this server is running PHP v5.2.8 so it will work (correctly))
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#46
<img src="../phpThumb.php?src=images/loco.jpg&w=300&fltr[]=smth" alt="">
Smooth filter
(only works with PHP v5.0.0+, this server is running PHP v5.2.8 so it will work (correctly))
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#47
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=gam|0.6" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=gam|1.6" alt="">
Gamma corrected to 0.6 vs. 1.6
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#48
<img src="../phpThumb.php?src=images/loco.jpg&w=200" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=brit|50" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=brit|-50" alt="">
Brightness filter (original vs. +50 vs. -50)
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#49
<img src="../phpThumb.php?src=images/loco.jpg&w=200" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=cont|50" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=cont|-50" alt="">
Contrast filter (original vs. +50 vs. -50)
(only works with GD v2.0+, this server is running GD "bundled (2.0.34 compatible)" so it will work)



#50
<img src="../phpThumb.php?src=images/pineapple.jpg&w=200&fltr[]=over|images/frame1.png|0" alt="">
<img src="../phpThumb.php?src=images/pineapple.jpg&w=200&fltr[]=over|images/frame2.png|1" alt="">
Overlay vs. Underlay

Original over/under images:

(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#51
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=wmt|phpThumb|18|C|FF0000|loki.ttf|100|5|20&f=png" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=wmt|%26%239786%3B%26%239835%3B%26%230470%3B%26%231694%3B|40|L|FF0000|arial.ttf|100&f=png" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=wmt|copyright+2009|3|BR|00FF00||50&f=png" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=wmt|copyright+2009%0AphpThumb()|3|L|00FFFF&f=png" alt="">
Text overlay, TTF and built-in fonts, unicode characters (rawurlencoded HTMLentities), multiple lines, metacharacters (height, width)
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#52
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=wmt|thumbnail+=+^Xx^Y|3|BR|00FFFF||50&f=png" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=wmt|click%0Ahere%0A^FkkB|10|L|FF00FF|arial.ttf|100|0||333399|50|y&f=png" alt="">
<img src="../phpThumb.php?src=images/loco.jpg&w=200&fltr[]=wmt|resized:+^Xx^Y+to+^xx^y|10|B|FFFFFF|arial.ttf|100|0||000000|100|x&f=png" alt="">
metacharacters (height, width), background color, background extend
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#53
<img src="../phpThumb.php?new=FF0000&w=100&h=50&fltr[]=bvl|10&fltr[]=wmt|hello|14|C|00FFFF|arial.ttf&f=png" alt="">
<img src="../phpThumb.php?new=FF0000|25&w=150&h=50&fltr[]=bvl|10&fltr[]=wmt|25%+opaque|14|C|0066FF|arial.ttf&f=png" alt="">
Image created with "new", red background, bevel, TTF text
(only works with GD (any version), this server is running GD "bundled (2.0.34 compatible)" so it will work)



#54
<img src="../phpThumb.php?src=images/winnt.bmp&w=200" alt="">
BMP source, width=200px



#55
<img src="../phpThumb.php?src=images/1024-none.tiff" alt="">
<img src="../phpThumb.php?src=images/1024-none.tiff&w=200&aoe=1" alt="">
TIFF source, width=200px
(requires ImageMagick, this server is running "6.2.8 04/17/08 Q16" so it will work)



#56
<img src="../phpThumb.php?src=images/computer.wmf&w=200" alt="">
WMF source, width=200px
(requires ImageMagick, this server is running "6.2.8 04/17/08 Q16" so it will work)



#pathinfo
 <img src="../phpThumb.php/fltr[]=sep;200x200;images/pineapple.jpg" alt=""> 
<img src="../phpThumb.php/f=png;fltr[]=wmt|hello;fltr[]=flip|y;fltr[]=wmt|hello;200x100;new=FF00FF" alt="">
PATH_INFO example




Illustration of potential difference between GD1.x and GD2.x
In most cases the thumbnails produced by phpThumb() on GD v1.x are perfectly acceptable, but in some cases it may look ugly. Diagonal lines and reducing a very large source image increase chance for bad results (the house/sky picture has both problems). Here are three static examples:
GD v2.0.15 kayak.jpg generated with phpThumb() on GD v2.0.15 bottle.jpg generated with phpThumb() on GD v2.0.15 sky.jpg generated with phpThumb() on GD v2.0.15
GD v1.6.2 kayak.jpg generated with phpThumb() on GD v1.6.2 bottle.jpg generated with phpThumb() on GD v1.6.2 sky.jpg generated with phpThumb() on GD v1.6.2



Demo of phpThumb.demo.showpic.php

Small picture (400x300), window opened at wrong size (640x480):
(mouse-over to see calling parameters)

unmodified text watermark

Big picture (2272x1704), window opened at wrong size (640x480):
(mouse-over to see calling parameters)

unmodified width=800 width=200, grayscale

The source images, without manipulation: