視覺效果 (Visual effects)
-
GPUImagePixellateFilter: Applies a pixellation effect on an image or video
- fractionalWidthOfAPixel: How large the pixels are, as a fraction of the width and height of the image (0.0 - 1.0, default 0.05)
-
GPUImagePolarPixellateFilter: Applies a pixellation effect on an image or video, based on polar coordinates instead of Cartesian ones
- center: The center about which to apply the pixellation, defaulting to (0.5, 0.5)
- pixelSize: The fractional pixel size, split into width and height components. The default is (0.05, 0.05)
-
GPUImagePolkaDotFilter: Breaks an image up into colored dots within a regular grid
- fractionalWidthOfAPixel: How large the dots are, as a fraction of the width and height of the image (0.0 - 1.0, default 0.05)
- dotScaling: What fraction of each grid space is taken up by a dot, from 0.0 to 1.0 with a default of 0.9.
-
GPUImageHalftoneFilter: Applies a halftone effect to an image, like news print
- fractionalWidthOfAPixel: How large the halftone dots are, as a fraction of the width and height of the image (0.0 - 1.0, default 0.05)
-
GPUImageCrosshatchFilter: This converts an image into a black-and-white crosshatch pattern
- crossHatchSpacing: The fractional width of the image to use as the spacing for the crosshatch. The default is 0.03.
- lineWidth: A relative width for the crosshatch lines. The default is 0.003.
-
GPUImageSketchFilter: Converts video to look like a sketch. This is just the Sobel edge detection filter with the colors inverted
- texelWidth:
- texelHeight: These parameters affect the visibility of the detected edges
- edgeStrength: Adjusts the dynamic range of the filter. Higher values lead to stronger edges, but can saturate the intensity colorspace. Default is 1.0.
-
GPUImageThresholdSketchFilter: Same as the sketch filter, only the edges are thresholded instead of being grayscale
- texelWidth:
- texelHeight: These parameters affect the visibility of the detected edges
- edgeStrength: Adjusts the dynamic range of the filter. Higher values lead to stronger edges, but can saturate the intensity colorspace. Default is 1.0.
- threshold: Any edge above this threshold will be black, and anything below white. Ranges from 0.0 to 1.0, with 0.8 as the default
-
GPUImageToonFilter: This uses Sobel edge detection to place a black border around objects, and then it quantizes the colors present in the image to give a cartoon-like quality to the image.
- texelWidth:
- texelHeight: These parameters affect the visibility of the detected edges
- threshold: The sensitivity of the edge detection, with lower values being more sensitive. Ranges from 0.0 to 1.0, with 0.2 as the default
- quantizationLevels: The number of color levels to represent in the final image. Default is 10.0
-
GPUImageSmoothToonFilter: This uses a similar process as the GPUImageToonFilter, only it precedes the toon effect with a Gaussian blur to smooth out noise.
- texelWidth:
- texelHeight: These parameters affect the visibility of the detected edges
- blurRadiusInPixels: The radius of the underlying Gaussian blur. The default is 2.0.
- threshold: The sensitivity of the edge detection, with lower values being more sensitive. Ranges from 0.0 to 1.0, with 0.2 as the default
- quantizationLevels: The number of color levels to represent in the final image. Default is 10.0
-
GPUImageEmbossFilter: Applies an embossing effect on the image
- intensity: The strength of the embossing, from 0.0 to 4.0, with 1.0 as the normal level
-
GPUImagePosterizeFilter: This reduces the color dynamic range into the number of steps specified, leading to a cartoon-like simple shading of the image.
- colorLevels: The number of color levels to reduce the image space to. This ranges from 1 to 256, with a default of 10.
-
GPUImageSwirlFilter: 旋渦形變币砂。
-
radius
: 半徑默認(rèn)0.5
. -
center
: 中心點(diǎn)范圍(0, 1.0)
, 默認(rèn)(0.5, 0.5)
岩齿。 -
angle
: 形變量, 默認(rèn)1.0
。
-
-
GPUImageBulgeDistortionFilter: 凸起形變。
-
radius
: 半徑默認(rèn) 0.25 -
center
: 要形變圖片的中心點(diǎn),范圍(0, 1)
护奈,默認(rèn)(0.5, 0.5)
绊寻。 -
scale
: 形變量, 范圍(-1.0, 1.0)
, 默認(rèn)0.5
。
-
-
GPUImagePinchDistortionFilter: 擠壓形變(Pinch)复斥。
-
radius
: 形變半徑营密,默認(rèn)1.0
。 -
center
: 要形變圖片的中心點(diǎn)目锭,范圍(0, 1)
评汰,默認(rèn)(0.5, 0.5)
。 -
scale
: 形變量, 范圍(-2.0, 2.0)
, 默認(rèn)1.0
痢虹。
-
-
GPUImageStretchDistortionFilter: 拉伸變形被去。
-
center
: 要形變圖片的中心點(diǎn),范圍(0, 1)
奖唯,默認(rèn)(0.5, 0.5)
惨缆。
-
-
GPUImageSphereRefractionFilter: 模擬通過玻璃球的折射。
-
center
: 形變的中心點(diǎn)丰捷,默認(rèn)(0.5, 0.5)
坯墨。 -
radius: 形變的半徑,范圍
(0, 1)
, 默認(rèn)0.25
病往。 -
refractiveIndex: 球體的折射率捣染,默認(rèn)
0.71
。
-
-
GPUImageGlassSphereFilter: 玻璃球荣恐,跟
GPUImageSphereRefractionFilter
類似, 只有圖像沒有反轉(zhuǎn)液斜,玻璃的邊緣有一些磨砂。-
center
: 形變的中心點(diǎn)叠穆,默認(rèn)(0.5, 0.5)
少漆。 -
radius
: 形變的半徑,范圍(0, 1)
, 默認(rèn)0.25
硼被。 -
refractiveIndex
: 球體的折射率示损,默認(rèn)0.71
。
-
-
GPUImageVignetteFilter: 暗角(暈影)
-
vignetteCenter
: 暗角中心點(diǎn) (CGPoint
), 默認(rèn)(0.5, 0.5)
嚷硫。 -
vignetteColor
: 暗角顏色 (GPUVector3
), 默認(rèn)黑色检访。 -
vignetteStart
: 暗角效果開始距中心點(diǎn)的標(biāo)準(zhǔn)化距離,默認(rèn)0.5
仔掸。 -
vignetteEnd
: 暗角效果結(jié)束距中心點(diǎn)的標(biāo)準(zhǔn)化距離, 默認(rèn)0.75
脆贵。
-
-
GPUImageKuwaharaFilter:
Kuwahara
圖抽象,取材于Kyprianidis
等人發(fā)表在GPU Pro
叢刊中的"Anisotropic Kuwahara Filtering on the GPU
起暮。
他們生成了一種類似油畫的圖像卖氨,但計(jì)算量極大,所以在iPad 2上面渲染一幀就需要幾秒。這可能最適合用于靜態(tài)圖筒捺。-
radius
: 整數(shù)類型柏腻,用于當(dāng)應(yīng)用濾鏡時(shí)測(cè)試中心像素以外的像素?cái)?shù),默認(rèn)值4
系吭。值越高五嫂,圖像會(huì)越抽象,處理所花的時(shí)間也會(huì)越長(zhǎng)肯尺。
-
-
GPUImagePerlinNoiseFilter: 生成充滿「柏林噪音」的圖像沃缘。
-
colorStart
:GPUVector4
類型,默認(rèn)白色则吟。 -
colorFinish
: 生成噪音的顏色范圍孩灯,GPUVector4
類型,默認(rèn)黑色逾滥。 -
scale
: 要生成噪音的尺度,默認(rèn)值8
败匹,最低值1
寨昙,值越高點(diǎn)越小,可通過混合模式生成噪點(diǎn)掀亩。
-
GPUImageCGAColorspaceFilter: 模擬CGA顯示器的色彩空間(Simulates the colorspace of a CGA monitor)舔哪。
-
GPUImageMosaicFilter(馬賽克): 此濾鏡采用輸入圖塊集,圖塊必須以亮度提升(This filter takes an input tileset, the tiles must ascend in luminance)槽棍。 It looks at the input image and replaces each display tile with an input tile according to the luminance of that tile. The idea was to replicate the ASCII video filters seen in other apps, but the tileset can be anything.
- inputTileSize:
- numTiles:
- displayTileSize:
- colorOn:
-
GPUImageJFAVoronoiFilter: 生成Voronoi地圖捉蚤,以備后用。
-
sizeInPixels
: 各個(gè)元素的size
炼七。
-
-
GPUImageVoronoiConsumerFilter: Takes in the Voronoi map, and uses that to filter an incoming image.
-
sizeInPixels: 各個(gè)元素的
size
缆巧。
-
sizeInPixels: 各個(gè)元素的
=======================================================
如上所述,你也可以用類似C語(yǔ)言的OpenGL Shading
語(yǔ)言豌拙,很輕松的編寫你自己定義的濾鏡陕悬。