视觉效果 (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: 半径默认0.5. -
center: 中心点范围(0, 1.0), 默认(0.5, 0.5)。 -
angle: 形变量, 默认1.0。
-
-
GPUImageBulgeDistortionFilter: 凸起形变。
-
radius: 半径默认 0.25 -
center: 要形变图片的中心点,范围(0, 1),默认(0.5, 0.5)。 -
scale: 形变量, 范围(-1.0, 1.0), 默认0.5。
-
-
GPUImagePinchDistortionFilter: 挤压形变(Pinch)。
-
radius: 形变半径,默认1.0。 -
center: 要形变图片的中心点,范围(0, 1),默认(0.5, 0.5)。 -
scale: 形变量, 范围(-2.0, 2.0), 默认1.0。
-
-
GPUImageStretchDistortionFilter: 拉伸变形。
-
center: 要形变图片的中心点,范围(0, 1),默认(0.5, 0.5)。
-
-
GPUImageSphereRefractionFilter: 模拟通过玻璃球的折射。
-
center: 形变的中心点,默认(0.5, 0.5)。 -
radius: 形变的半径,范围
(0, 1), 默认0.25。 -
refractiveIndex: 球体的折射率,默认
0.71。
-
-
GPUImageGlassSphereFilter: 玻璃球,跟
GPUImageSphereRefractionFilter类似, 只有图像没有反转,玻璃的边缘有一些磨砂。-
center: 形变的中心点,默认(0.5, 0.5)。 -
radius: 形变的半径,范围(0, 1), 默认0.25。 -
refractiveIndex: 球体的折射率,默认0.71。
-
-
GPUImageVignetteFilter: 暗角(晕影)
-
vignetteCenter: 暗角中心点 (CGPoint), 默认(0.5, 0.5)。 -
vignetteColor: 暗角颜色 (GPUVector3), 默认黑色。 -
vignetteStart: 暗角效果开始距中心点的标准化距离,默认0.5。 -
vignetteEnd: 暗角效果结束距中心点的标准化距离, 默认0.75。
-
-
GPUImageKuwaharaFilter:
Kuwahara图抽象,取材于Kyprianidis等人发表在GPU Pro丛刊中的"Anisotropic Kuwahara Filtering on the GPU。
他们生成了一种类似油画的图像,但计算量极大,所以在iPad 2上面渲染一帧就需要几秒。这可能最适合用于静态图。-
radius: 整数类型,用于当应用滤镜时测试中心像素以外的像素数,默认值4。值越高,图像会越抽象,处理所花的时间也会越长。
-
-
GPUImagePerlinNoiseFilter: 生成充满「柏林噪音」的图像。
-
colorStart:GPUVector4类型,默认白色。 -
colorFinish: 生成噪音的颜色范围,GPUVector4类型,默认黑色。 -
scale: 要生成噪音的尺度,默认值8,最低值1,值越高点越小,可通过混合模式生成噪点。
-
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: 各个元素的size。
-
-
GPUImageVoronoiConsumerFilter: Takes in the Voronoi map, and uses that to filter an incoming image.
-
sizeInPixels: 各个元素的
size。
-
sizeInPixels: 各个元素的
=======================================================
如上所述,你也可以用类似C语言的OpenGL Shading语言,很轻松的编写你自己定义的滤镜。