TimThumb Parameters

stands for values What it does

src

---

source

图像的URL

-------------

Tells TimThumb which image to resize › TimThumb basic properties tutorial

---------------------------------------------------------------------------------------------------------------------------------------------------------

w

---

width

显示的宽

-------------

Remove the width to scale proportionally (will then need the height) › TimThumb width tutorial

---------------------------------------------------------------------------------------------------------------------------------------------------------

h

---

height

显示的高

-------------

Remove the height to scale proportionally (will then need the width) › TimThumb height tutorial

---------------------------------------------------------------------------------------------------------------------------------------------------------

q

---

quality

0 – 100

-------------

压缩质量。更高更好的图像数量会看。我不建议继续高于其他约95图像将得到太大 › TimThumb image quality tutorial

---------------------------------------------------------------------------------------------------------------------------------------------------------

a

---

alignment

c, t, l, r, b, tl, tr, bl, br

-------------

  • c : position in the center (this is the default)
  • t : align top
  • tr : align top right
  • tl : align top left
  • b : align bottom
  • br : align bottom right
  • bl : align bottom left
  • l : align left
  • r : align right

---------------------------------------------------------------------------------------------------------------------------------------------------------

zc

---

zoom / crop

0, 1, 2, 3

-------------

0 调整到适合页面指定尺寸(无裁剪)
1 作物和调整大小,以最适合的尺寸(默认)
2 按比例调整大小,以适应整个图像到指定的尺寸,如果需要添加边框
3 调整比例调整缩放图像的大小,所以有没有国界的差距

例子: http://localhost/timthumb.php?src=http://localhost/upload/201309/1378783132443700981.jpg&h=156&w=276&zc=2

---------------------------------------------------------------------------------------------------------------------------------------------------------

f

---

filters

too many to mention

-------------

图像过滤器和参数,你可以使用:

  • 1 =非 -反转颜色
  • 2 =灰度 -转成深浅不一的灰色形象
  • 3 =亮度 -调整图像的亮度。需要1个参数来指定的亮度要添加量。值可以为负值使图像变暗。
  • 4 =对比度 -调整图像的对比度。需要1个参数指定适用于少量的造影剂。大于0的值会降低对比度和小于0将增加对比度。
  • 5 =着色/色调 -图像应用颜色洗。需要所有的过滤器的大部分参数。参数是RGBA
  • 6 =边沿检测 -检测图像边缘
  • 7 =浮雕 -浮雕图像(给它一种深度),可以结合上面了colorize滤波器时好看。
  • 8 =高斯模糊 -模糊的图像,不幸的是,你可以不指定金额,但你可以申请多次相同的过滤器(如图所示在演示)
  • 9 =选择性模糊 -模糊了不同类型的。不知道有什么区别,但比高斯模糊,这种模糊是不太强。
  • 10 =平均去除率 -使用平均去除率创建一个“粗略”的效果。
  • 11 =平滑 -使图像平滑。

多一次过滤器

为了使这个超级灵活,我想这将是很好,如果我能链的过滤器一起使用多个过滤器在一个单一的形象。要做到这只是独立的多个过滤器使用管道字符,然后通过一大堆TimThumb。例如,下面的值中,将适用于10亮度的灰度图像:

F = 2 | 1,10


例子 :http://www.binarymoon.co.uk/demo/timthumb-filters/ -------------------------------------------------------------------------------------------------------------------

s

---

sharpen -------------

锐化过滤器,参数为1

---------------------------------------------------------------------------------------------------------------------------------------------------------

cc

---

canvas colour

hexadecimal colour value (#ffffff)

-------------

更改背景颜色。最常用的改变缩放和裁剪设置,这反过来又可以添加边框的图像时。

---------------------------------------------------------------------------------------------------------------------------------------------------------

ct

---

canvas transparency

true (1)

-------------

使用的透明度和忽略的背景颜色,参数为1。

---------------------------------------------------------------------------------------------------------------------------------------------------------

 

使用例子: http://localhost/timthumb.php?src=http://localhost/upload/201309/1378783132443700981.jpg&w=276&h=156&zc=2