Crt display

From Avisynth wiki
Jump to: navigation, search
Author cretindesalpes
Version v1.0
Category Effects
Discussion Doom9 Thread


[edit] Description

crt_display is a function that emulates a CRT display using aperture grille (Trinitron) or Cromaclear technologies. It is slow but gives interesting results. It implements various features like:

  • Works at any (non-integer) upscaling factor
  • Various ways of adjusting the scanline thickness and beam shape
  • Low-pass filtering of the input signal
  • Specific gamma target
  • Beam glow
  • Optional colored phosphor effect and shadow mask
  • Colors shift caused by beam misalignment
  • Automatic contrast adjustment
  • Halation
  • Very large upscale is possible, showing the grid of phosphors.

[edit] Requirements

[edit] Required Plugins

Latest version of the following plugins are recommended unless stated otherwise.

[edit] Syntax and Parameters


crt_display (clip src, float sw, float sh, float "voff", float "ppp",
\	float "cutoff", float "scandist", float "sharpv", float "sharph",
\	float "blurh", float "glowgain", float "glowh", float "glowv",
\	float "glowsens", float "contrast", float "gamma", float "softclip",
\	float "mix", float "beamshape", bool "phosphor", bool "pgrid",
\	float "vcs", float "cromaclear", float "maskpp", float "gainb",
\	float "halgain", float "halrange", string "pixel_type")


	Horizontal scale factor.

	Vertical scale factor.

	Vertical centering of the scanlines.
	Set to 0, the scanlines are centered between two pixels. When set to
	0.5, the scanline are centered exactly on a pixel. Default is pixel-
	This is a sensitive setting when the scale factor is a small integer.
	When sh = 3, it's recommended to set the value closer to 0 to make
	centered the dark gap between the scanlines.

	Number of phosphor triads per source pixel.
	It is recommended to select a value that makes the phosphors aligned
	with destination pixels (for example 1 phosphor triad = 2 dest pix),
	in order to avoid moire patterns and beating.

	Cutoff frequency of the low-pass filter at the electronic level.
	Lowering it thinners 1-pixel wide details.
	Good values are between 0.8 and 1. Effect is disabled at 1.0.

	Relative distance between two scanlines.

	Vertical sharpness of the scanlines.
	High sharpness makes the lines look thinner especially at low
	luminance and may reduce the overall contrast.
	Low sharpness thickens the lines and make them slightly blend.
	Use values between 0.5 and 2.0.

	Horizontal beam focus.
	Use values between 0.5 and 2.0.

	Amount of horizontal bluring to apply after the final resizing.
	Requires phosphor to be set. Set it to 0 to disable bluring.
	Sometimes with medium scale factors, when the individual phosphors
	have a size close to a single destination pixel, the display becomes
	incredibly messy. Blurring in the horizontal direction make the
	neighbour phophors slightly merge and reduce the gird artefacts.
	Moreover, it alows to amplify more the contrast with reduced
	color artefacts.
	Usually, values in range 1.0-2.0 give good results.
	The sweet spot can be very narrow, don't hesitate to try steps
	as small as 0.1. It's also very dependent from other settings,
	adjust it after other parameters have changed.

	Amount of glow left by the beam.
	Disabled when set to 0.

	Width of the beam glow, in phosphor triads.

	Height in scanlines of the beam glow.

	Glow sensitivity to light.
	With 1 the glow is uniform. Greater values will leave the dark spots
	intact and only make the bright spots glow.

	Manual contrast amplification. The neutral value is 1.
	The value of 3 is generally good when the scaling factor is not high
	and the individual phosphors overlap. Use a slightly greater value
	when cromaclear is enable (should be 4).
	Contrast loss caused by thin scanlines or large phosphors is hard to
	When unspecified, the contrast is set as high as possible depending
	on the other parameters.

	Gamma of the emulated monitor. Typically 2.4 to 2.8 for CRT monitors.
	Default is the sRGB gamma (2.2).

	Gently saturates the pixel values.
	Generally in range 0-1. Slightly reduces the overall contrast when
	pixel values are not clipping.
	Set to 0 for hard-clipping.

	Amount of CRT-emulated picture in the result. Does not bypass the
	gamma processing.

	Another way to sharpen the scanlines. The higher the value, the
	thinner the beam. Use values between 1 and 3. This gives control on
	the thickness of the beam at high luminance.

	Enable phosphor processing.

	Enables the black grid enclosing each phosphor, at the price of a
	higher calculation cost. Useful only for large scale factors, when
	individual phosphors are clearly visible.
	Requires phosphor processing.

	Vertical color shift in scanline units, misaligning the red and blue
	Realistic values are between -0.25 and +0.25. When set to 0, the beams
	are correctly aligned.

	Implements the NEC's cromaclear variant of the aperture grille,
	combining it with a shadow mask. The value gives the amount of
	horizontal black grid to be mixed.
	May reduce the contrast.

	Number of cromaclear units per scanline. Same as ppp but vertically.

	Manual contrast gain for the blue.
	For some reasons, the phosphor mix may generate a yellow tint in the
	high luminance ranges, depending on various parameters.
	Values ranging from 1.05 to 1.2 are generally enough to fix it without
	creating excessive blue tint in the darker colors.
	Use a test pattern to adjust the value.

	Amount of halation.
	Keep it to a low value, typically in range 0.01-0.05.
	Disable it with 0.

	Halation radius, in phosphor triad units.

	Final RGB format. "RGB24" or "RGB32".

[edit] Examples

See examples in the Doom9 discussion thread.

[edit] Changelog

Version      Date            Changes
v1.0 2014/06/05 - Initial release

[edit] External Links

Back to External Filters

Personal tools