Skip to content
Attempting to improve consistency with heading capitalisation, and creating a... authored by Kevin Meaney's avatar Kevin Meaney
Attempting to improve consistency with heading capitalisation, and creating a yard contents markdown file.
......@@ -2,7 +2,7 @@
## Image Filter Chains
### Tracking down errors
### Tracking Down Errors
When something goes wrong with the interpretation of the json or plist data when creating or rendering a image filter chain object then smig will return a terse error message. When this happens there will be useful information in MovingImages' log file. The [Introduction to using MovingImages debugging section describes how to view the log file](Introduction#debugging).
......@@ -35,7 +35,7 @@ To get a list of all the available CoreImage filters on the command line:
smig getproperty -type imagefilterchain -property imagefilters
### Getting the attributes of a CoreImage filter
### Getting the Attributes of a CoreImage Filter
To be able to create a property list dictionary or json object that you use to setup a core image filter in a filter chain, you need to know what the list of keys are for each filter are and for each key what the range of allowed values is that can be assigned to the filter. To get the filter description you can get the "imagefilterattribute" property from the "imagefilterchain" type. The information can be returned in one of 3 ways. Either as a json string (see the example below) or saved to a json or a plist file (-jsonfile, -plistfile). If saving to a file then after the (-jsonfile, -plistfile) option you need to provide a file path.
......@@ -49,7 +49,7 @@ To get the CIDroste filter attributes on the command line:
Both these methods return the compact form of the json string. To view a human friendly version, copy the result and paste it into either: [JSONLint](http://jsonlint.com) or [JSON Editor online](http://jsoneditoronline.org).
### Setting up the properties for a filter
### Setting up the Properties for a Filter
All but a few of the core image filters require inputs. All the numerical inputs for the filters have default values which means for a quick test of a filter you don't need to assign these values. Other input types like the CIImage class, are required as they don't have a default, and input types like CIVector and CIColor have default values, but the default values need to be overridden.
......@@ -167,7 +167,7 @@ puts JSON.pretty_generate(radialgradient_filter.filterhash)
```
### Chaining filters together
### Chaining Filters Together
The following json object is everything needed to define the filter chain managed by a "imagefilterchain" base object. The render destination is specified using the "cirenderdestination" key. The value for the "cifilterlist" key is a list of filter objects each one describing one filter in the filter list. The order of the filters in this list is important, for a few reasons. The outputImage of the last filter in the filter chain is the the one that renders to the render destination. Since you can refer to an earlier filter in the filter chain by its filter index "cifilterindex" then the order needs to be correct or alternatively if you refer to filters by their name identifier you can only refer to filters earlier in the list of filters.
......@@ -478,7 +478,7 @@ I originally wrote a ruby script before I had created a ruby gem which generated
![Bump distortion gif animation](https://gitlab.com/ktam/using-movingimages/raw/master/wiki-images/EmbossedBumpDistortionAnimation.gif "An embossed bump distortion image animation.")
### Providing input images
### Providing Input Images
An input image for a filter can come from either the output image of an earlier filter in the filter chain or from a base object. Both of these ways of supplying an input image to a filter has been demonstrated above.
......@@ -528,7 +528,7 @@ If the base object reference identifies a "imageimporter" object or if the "obje
}
}
### Rendering an Image Filter Chain object
### Rendering an Image Filter Chain Object
#### Render Destination
......@@ -644,7 +644,7 @@ If the destination rectangle is not specified, then the rectangle drawn to is th
}
```
### Equations and variables when rendering
### Equations and Variables when Rendering
For an example of drawing shapes using equations and variables please see the [Drawing with equations and variable section](Drawing#drawing-with-equations-and-variables) in the drawing documentation. The ruby code complete example demonstrates how the equations and variables work.
......@@ -718,7 +718,7 @@ The JSON generated from the above looks like:
}
```
### Creating the image filter chain object
### Creating the Image Filter Chain Object
The above ruby script demonstrates how to build up a filter chain and create an "imagefilterchain" base object.
......@@ -736,7 +736,7 @@ Creating an image filter chain object with the property list dictionary defined
smig create -type "imagefilterchain" -name "com.yvs.documentation.unsharpmaskfilterchain" -propertyfile "~/PLISTFilterFiles/unsharpmask.plist"
### The Image Filter Chain ruby processing scripts
### The Image Filter Chain Ruby Processing Scripts
The examples for using the image filter chain scripts assumes that the scripts are in a folder that is in your PATH. These scripts were written prior to writing the ruby gem and are all self contained. They should be rewritten using the moving_images ruby gem.
......@@ -829,7 +829,7 @@ One example of the use of the dotransition script is, though you'll need to upda
The "embossimage" script is more a demonstration script than a general purpose script, and is the basis for how I have demonstrated many of the features of the image filter chain object and how to chain filters together as described the documentation. Nevertheless the script has a number of inputs making it possible to view how changing input values affects the produced output.
### The YVSChromaKey filter
### The YVSChromaKey Filter
As well as the built in Core Image filters I have added another filter for use with Moving Images. It is called YVSChromaKeyFilter and allows you to make parts of an image based on a selected color transparent. The filter has three inputs, a chroma key color "inputColor" which is defined as a CIVector, a distance number "inputDistance" which is distance in a color space within which the image is made fully transparent and a slope number "inputSlopeWidth" which is also a distance in a color space and this is the width of the slope. The smaller the width the steeper the slope.
......
......