Class VideoEffectPosterize
- Namespace
- VisioForge.Core.Types.VideoEffects
- Assembly
- VisioForge.Core.dll
Represents a posterization effect that reduces the number of color levels in the video, creating a stylized, flat-color appearance similar to silk-screen printing or pop art.
public class VideoEffectPosterize : VideoEffect, IVideoEffectPosterize, IVideoEffectInheritance
Implements
Inherited Members
Remarks
The posterize effect reduces color depth by quantizing color values to a limited number of discrete levels. Instead of smooth color gradients, the image displays areas of flat, solid colors with sharp transitions between them. This creates an artistic effect reminiscent of poster art, screen printing, or vintage political propaganda posters.
SDK Availability: VideoCaptureCore, MediaPlayerCore, VideoEditCore (Windows only)
Platform Support: Windows only
Technical details: The effect works by reducing the number of bits used to represent each color channel. Higher posterization values allow more color levels, creating subtler effects. Lower values restrict colors to fewer levels, producing more dramatic posterization with larger flat-color regions.
Common use cases include:
- Creating pop art and Andy Warhol-style artistic effects
- Stylized graphics for music videos and creative content
- Retro and vintage aesthetic effects
- Comic book and graphic novel visual styles
- Animated transitions between realistic and stylized looks
The posterization intensity can be animated by specifying different VisioForge.Core.Types.VideoEffects.VideoEffectPosterize.Value and VisioForge.Core.Types.VideoEffects.VideoEffectPosterize.ValueStop values. The effect will automatically interpolate between these values, enabling smooth transitions from photorealistic to heavily posterized imagery.
Performance: This is a CPU-based effect with moderate computational requirements. The performance impact is generally consistent regardless of the posterization level chosen.
Constructors
VideoEffectPosterize(int, int, string, TimeSpan, TimeSpan, bool)
Initializes a new instance of the VisioForge.Core.Types.VideoEffects.VideoEffectPosterize class with specified parameters.
public VideoEffectPosterize(int value = 50, int valueStop = 0, string name = "posterize", TimeSpan startTime = default, TimeSpan stopTime = default, bool enabled = true)Parameters
valueint-
The posterization level. Higher values allow more color levels and produce subtler effects. Lower values restrict colors to fewer levels, creating more dramatic poster art effects. Default is 50 (moderate posterization). Valid range is 1 to 255.
valueStopint-
The ending posterization level for animated transitions. Set to 0 to disable animation and maintain constant intensity at
value. When non-zero, the posterization level will interpolate betweenvalueand this value over the effect's time range. Default is 0 (no animation). Valid range is 0 to 255. namestring-
An optional name identifier for this effect instance. Default is "posterize". Used to retrieve specific effect instances from a collection via the name property. Multiple effects with the same type can coexist with different names.
startTimeTimeSpan-
The time at which the effect should start being applied. Default is Zero, which applies the effect from the beginning. Use a specific time value to delay the effect start.
stopTimeTimeSpan-
The time at which the effect should stop being applied. Default is Zero, which applies the effect until the end. Set to a specific time to limit the effect duration. When using animated transitions with
valueStop, this defines the end point of the animation. enabledbool-
trueto enable the effect immediately;falseto create the effect in a disabled state. The effect can be enabled/disabled later using the VisioForge.Core.Types.VideoEffects.VideoEffect.Enabled property. Default istrue.
Remarks
If both startTime and stopTime are zero (default),
the effect will be applied for the entire video duration.
For best artistic results, experiment with different posterization values. Very low values (1-10) create high-contrast pop art effects, while moderate values (30-70) provide more balanced stylization.
Properties
Value
Gets or sets the posterization level (starting value for animations).
public int Value { get; set; }Property Value
Remarks
Controls the number of color levels available in the posterized output. Higher values allow more color levels and produce subtler posterization effects with smoother transitions. Lower values restrict the palette to fewer colors, creating more dramatic, high-contrast poster-like imagery.
Typical value ranges and their effects:
- 1-10: Extreme posterization, very few colors, stark contrasts
- 11-30: Strong posterization, clear flat-color regions, poster art style
- 31-70: Moderate posterization, visible effect but retains detail
- 71-100: Subtle posterization, slight color banding
- 100+: Minimal posterization, approaching original image
When VisioForge.Core.Types.VideoEffects.VideoEffectPosterize.ValueStop is set to a different non-zero value, this property serves as the starting value for an animated transition.
ValueStop
Gets or sets the ending posterization level for animated transitions (optional).
public int ValueStop { get; set; }Property Value
Remarks
When set to a non-zero value different from VisioForge.Core.Types.VideoEffects.VideoEffectPosterize.Value, the posterization level will automatically interpolate between VisioForge.Core.Types.VideoEffects.VideoEffectPosterize.Value and VisioForge.Core.Types.VideoEffects.VideoEffectPosterize.ValueStop over the effect's duration (from VisioForge.Core.Types.VideoEffects.VideoEffect.StartTime to VisioForge.Core.Types.VideoEffects.VideoEffect.StopTime).
Animation examples:
- Value=100, ValueStop=10: Gradually increase posterization (realistic to stylized)
- Value=10, ValueStop=100: Gradually decrease posterization (stylized to realistic)
- ValueStop=0: No animation, constant posterization at Value
Set to 0 to disable animation and maintain constant posterization intensity at VisioForge.Core.Types.VideoEffects.VideoEffectPosterize.Value.
Methods
GetEffectType()
Gets the specific type of this video effect.
public VideoEffectType GetEffectType()Returns
- VideoEffectType
-
Returns VisioForge.Core.Types.VideoEffects.VideoEffectType.Posterize to identify this as a posterization effect.
Remarks
This method overrides the base class implementation to provide the concrete effect type. The effect type is used by the video processing pipeline to route the effect to the appropriate posterization processing module.