Chainmax
14th November 2006, 21:44
The main points I'd like to cover are wether this will do its intended work and what would be the easiest/fastest way to make an Avisynth dll filter out of it. Here it is:
Here it is:
-------------------------------------------------------------------------------------------------------------------
Filter name: to be determined
The purpose of this filter is to make a source look like a flash animation, more or less like the following example:
http://img211.imageshack.us/img211/8876/cartcomp8dl.png
This filter works in RGB progressive videos. For other kinds of source, colorspace conversions and SeparateFields().[filter].Weave() or similar methods should be enough.
Operation: a matrix of user-defined dimensions is created around a pixel. Averages of the R, G and B values of every pixel in the matrix are calculated and the resulting "average color" is compared against each color from the palette. The color of the examined pixel will then be replaced to the palette color that's closest to this "averaged color". If no palette is selected, the examined pixel will be replaced by the "averaged color".
As optional postprocessing options, the user will be able to select border highliting and/or HQAA antialiasing.
PARAMETERS:
Palette: can be set to 0 (no palette), 1 (8-color palette), 2(16-color palette).
ML,MR,MU,MD: integer. It indicates how many pixels to the left, right, top and bottom of the examined one will comprise the matrix. For example:
ML=2,MR=3,MU=1,MD=0:
http://img189.imageshack.us/img189/183/mex1db.png (http://imageshack.us)
Defaults: ML=MR=MU=MD=1
If the matrix around a given pixel has some elements that fall outside the frame, they are not considered, for example:
http://img83.imageshack.us/img83/6716/ignex2fp.png (http://imageshack.us)
FM: filling method. Can be set to 1 (only the examined pixel's RGB values are changed) or 2 (all the pixels in the valid matrix's RGB values are changed).
Default: 1
UOF: use original frame (boolean). When operating on a given pixel, if set to true it uses the original frame and if set to false it takes into account the changes made up to then.
Default: true
POSTPROCESSING OPTIONS:
border: integer, 0 to 16 or 0 to 8. It uses one of the colors from the selected palette. If set to 0 or if palette was set to 0 then no border will be created.
Default: 1 (black)
Border creation algorithm: for every pixel, its eight (three for corner pixels and five for border pixels) surrounding neighbors are checked. If any of those surrounding pixels has a different color, then that pixel and the examined one are recolored with the selected border color. For example, with yellow border color:
http://img439.imageshack.us/img439/8217/bex0da.png (http://imageshack.us)
HQAA: a 1X version of Maxim Stepin's magnification filters (http://www.hiend3d.com/hq3x.html) meant to do antialiasing on the result.
-------------------------------------------------------------------------------------------------------------------
Any kind of feedback will be welcome.
Here it is:
-------------------------------------------------------------------------------------------------------------------
Filter name: to be determined
The purpose of this filter is to make a source look like a flash animation, more or less like the following example:
http://img211.imageshack.us/img211/8876/cartcomp8dl.png
This filter works in RGB progressive videos. For other kinds of source, colorspace conversions and SeparateFields().[filter].Weave() or similar methods should be enough.
Operation: a matrix of user-defined dimensions is created around a pixel. Averages of the R, G and B values of every pixel in the matrix are calculated and the resulting "average color" is compared against each color from the palette. The color of the examined pixel will then be replaced to the palette color that's closest to this "averaged color". If no palette is selected, the examined pixel will be replaced by the "averaged color".
As optional postprocessing options, the user will be able to select border highliting and/or HQAA antialiasing.
PARAMETERS:
Palette: can be set to 0 (no palette), 1 (8-color palette), 2(16-color palette).
ML,MR,MU,MD: integer. It indicates how many pixels to the left, right, top and bottom of the examined one will comprise the matrix. For example:
ML=2,MR=3,MU=1,MD=0:
http://img189.imageshack.us/img189/183/mex1db.png (http://imageshack.us)
Defaults: ML=MR=MU=MD=1
If the matrix around a given pixel has some elements that fall outside the frame, they are not considered, for example:
http://img83.imageshack.us/img83/6716/ignex2fp.png (http://imageshack.us)
FM: filling method. Can be set to 1 (only the examined pixel's RGB values are changed) or 2 (all the pixels in the valid matrix's RGB values are changed).
Default: 1
UOF: use original frame (boolean). When operating on a given pixel, if set to true it uses the original frame and if set to false it takes into account the changes made up to then.
Default: true
POSTPROCESSING OPTIONS:
border: integer, 0 to 16 or 0 to 8. It uses one of the colors from the selected palette. If set to 0 or if palette was set to 0 then no border will be created.
Default: 1 (black)
Border creation algorithm: for every pixel, its eight (three for corner pixels and five for border pixels) surrounding neighbors are checked. If any of those surrounding pixels has a different color, then that pixel and the examined one are recolored with the selected border color. For example, with yellow border color:
http://img439.imageshack.us/img439/8217/bex0da.png (http://imageshack.us)
HQAA: a 1X version of Maxim Stepin's magnification filters (http://www.hiend3d.com/hq3x.html) meant to do antialiasing on the result.
-------------------------------------------------------------------------------------------------------------------
Any kind of feedback will be welcome.