ImageEn, unit iexProcEffects

TIEImageEffect


Description

Stores all the parameters of a particular image effect or editing operation, e.g. rotating 90 deg. or increasing contast by 20%

This class provides read/write access to the parameters of the Image Processing Dialog (displayed by calling DoPreviews).
It can also be used to build a chain of a effects to apply to an image.


General Fields

Public Property  Enabled: Boolean;
Public Property  Operation: TPreviewEffect;
Public Property  DialogWidth: Integer;
Public Property  DialogLeft: Integer;
Public Property  DialogTop: Integer;
Public Property  DialogHeight: Integer;


Effect Fields

Auto Enhancement (peAutoEnhance)
Public Property  AutoEnhance_Method: Integer; (See AutoEnhance Method Constants)
Public Property  AutoEnhance1_Slope: Integer;
Public Property  AutoEnhance1_Range : Integer;
Public Property  AutoEnhance1_Quality : Integer;
Public Property  AutoEnhance3_Gamma : Double;
Public Property  AutoEnhance3_Saturation : Integer;
Uses one of: AutoImageEnhance1, AutoImageEnhance3, AdjustGainOffset, WallisFilter, WhiteBalance_AutoWhite

Bump Map (peBumpMap)
Public Property  BumpMap_Left: Integer;
Public Property  BumpMap_Top: Integer;
Public Property  BumpMap_Width: Integer;
Public Property  BumpMap_Height: Integer;
Public Property  BumpMap_Col: TRGB;
Public Property  BumpMap_Src: Integer;
Public Property  BumpMap_Auto: Boolean;
Uses BumpMapping

Color Curve (peColorCurve)
Public Property  ColorCurve_CurvePoints : AnsiString;
Public Property  ColorCurve_Channel : TIECurveChannel;
Uses ApplyCurve

Contrast and Brightness (peContrast)
Public Property  Contrast_Contrast: Integer;
Public Property  Contrast_Brightness: Integer;
Uses Contrast, or IntensityRGBAll for brightness

Cropping (peCrop)
Public Property  Crop_Left : Integer;
Public Property  Crop_Top : Integer;
Public Property  Crop_Right : Integer;
Public Property  Crop_Bottom : Integer;
Public Property  Crop_BackgroundColor : TColor;
Public Property  Crop_Shape : TIEShape;
Public Property  Crop_LockAspectRatio: Double;
Uses Crop, or ImageResize if Crop values are negative

Equalization (peEqualize)
Public Property  Equalization_ThresholdDown: TRGB;
Public Property  Equalization_ThresholdUp: TRGB;
Public Property  Equalization_EqDown: TRGB;
Public Property  Equalization_EqUp: TRGB;
Public Property  Equalization_AutoEqualize: Boolean;
Public Property  Equalization_Gray: Boolean;
Public Property  Equalization_Blue: Boolean;
Public Property  Equalization_Green: Boolean;
Public Property  Equalization_Red: Boolean;
Uses Threshold, HistEqualize and HistAutoEqualize (if Equalization_AutoEqualize is true)

Fourier Transformation (peFFT)
Public Property  FFT_Left: Integer;
Public Property  FFT_Top: Integer;
Public Property  FFT_Right: Integer;
Public Property  FFT_Bottom: Integer;
Public Property  FFT_GrayScale: Boolean;
Public Property  FFT_Selection: TMemoryStream;
Uses FTConvertFrom

Gamma Correction (peGamma)
Public Property  GammaCorrection_Red: Boolean;
Public Property  GammaCorrection_Green: Boolean;
Public Property  GammaCorrection_Blue: Boolean;
Public Property  GammaCorrection_Value: Double;
Uses GammaCorrect

HSL (peHSL)
Public Property  HSL_H: Integer;
Public Property  HSL_S: Integer;
Public Property  HSL_L: Integer;
Uses HSLvar

HSV (peHSV)
Public Property  HSV_H: Integer;
Public Property  HSV_S: Integer;
Public Property  HSV_V: Integer;
Uses HSVvar

Lens Effect (peLens)
Public Property  Lens_Left: Integer;
Public Property  Lens_Top: Integer;
Public Property  Lens_Width: Integer;
Public Property  Lens_Height: Integer;
Public Property  Lens_Ref: Double;
Public Property  Lens_Auto: Boolean;
Uses Lens

Level Adjustment (peLevels)
Public Property  Levels_Shadow: Byte;
Public Property  Levels_MidTone: Byte;
Public Property  Levels_Highlight: Byte;
Public Property  Levels_OutShadow: Byte;
Public Property  Levels_OutHighlight: Byte;
Uses AdjustLevels

Morph Filter (peMorph)
Public Property  Morph_Filter: Integer; (See Morph Filter Constants)
Public Property  Morph_WinSize: Integer;
Uses Minimum, Maximum, Opening and Closing

Pixelization (pePixelize)
Public Property  Pixelize_BlockSize: Double;
Uses Pixelize

Resampling/Scaling (peResize)
Public Property  Resize_ByPercent: Boolean;
Public Property  Resize_Height: Double;
Public Property  Resize_MaintainAR: Boolean;
Public Property  Resize_QualityFilter: TResampleFilter;
Public Property  Resize_Width: Double;
Uses Resample. Resize_ByPercent determines whether Resize_* values specify a percentage, such as 50, or a fixed pixel size, such as 1000.

RGB (peRGB)
Public Property  RGB_R: Integer;
Public Property  RGB_G: Integer;
Public Property  RGB_B: Integer;
Uses IntensityRGBAll

Rotate and Flip (peRotate)
Public Property  Rotate_Angle: Double;
Public Property  Rotate_AndCrop: Boolean;
Public Property  Rotate_CropAlgorithm: TIECropAlgorithm;
Public Property  Rotate_BackgroundColor: TColor;
Public Property  Rotate_AntiAlias: TIEAntialiasMode;
Public Property  Flip_Horz: Boolean;
Public Property  Flip_Vert: Boolean;
Uses Rotate, RotateAndCrop or Flip

Sharpen (peSharpen)
Public Property  Sharpen_Sharpen: Integer;
Public Property  Sharpen_Size: Integer;
Public Property  Sharpen_AutoSharp: Boolean;
Uses Sharpen, or AutoSharp if Sharpen_AutoSharp = true

Soft Shadow (peSoftShadow)
Public Property  Shadow_Color : TColor;
Public Property  Shadow_Position: TIEShadowPosition;
Public Property  Shadow_Radius : Integer;
Public Property  Shadow_Offset : Integer;
Uses AddSoftShadow, or AddInnerShadow if Shadow_Position = iespInner

Smooth (peSmoothing)
Public Property  Smooth_Method: Integer; (See Smoothing Method Constants)
Public Property  Smooth_Strength: Integer;
Uses one of: SymmetricNearestNeighbour, Blur, UnsharpMask, fastNlMeansDenoisingColored, smooth

User Filter (peUserFilt)
Public Property  UserFilter_Values: TGraphFilter;
Uses ApplyFilter

Transparency (peTransparency)
Public Property  Transparency_Method: Integer; (See Transparency Method Constants)
Public Property  Transparency_OriginX: Integer;
Public Property  Transparency_OriginY: Integer;
Public Property  Transparency_SourceColor: TColor;
Public Property  Transparency_ColorTolerance: Integer;
Public Property  Transparency_MaxFilter: Boolean;
Public Property  Transparency_ChromaTolerance: Double;
Public Property  Transparency_ChromaSaturation: Integer;
Public Property  Transparency_ChromaFeathering: Integer;
Uses one of: CastAlpha, SetTransparentColors, RemoveChromaKey

Other Color Methods (peOtherColor)
Public Property  OtherColor_Method: Integer; (See Other Color Method Constants)
Public Property  Colorize_Hue: Integer;
Public Property  Colorize_Saturation: Integer;
Public Property  Colorize_Luminosity: Double;
Uses one of: ConvertToGray, ConvertToSepia, Colorize, Negative, WhiteBalance_GrayWorld

Other Effects (peOtherEffects)
Public Property  OtherEffect_Method: Integer; (See Other Effect Constants)
Public Property  Wave_Amplitude: Integer;
Public Property  Wave_WaveLength: Integer;
Public Property  Wave_Phase: Integer;
Public Property  Wave_Reflect: Boolean;
Uses one of: Wave, Reflection, PencilSketch


Other

Public Method  Assign
Public Property  AsHash
Public Property  AsString
Public Method  Description
Public Method  GetProperty
Public Method  LoadFromFile
Public Method  LoadFromIniFile
Public Method  LoadFromRegistry
Public Method  LoadFromStream
Public Method  SaveToFile
Public Method  SaveToIniFile
Public Method  SaveToRegistry
Public Method  SaveToStream
Public Method  SetProperty
Public Method  SetDefaultParams


Demos

Demo  Demos\ImageEditing\EffectsChain\EffectsChain.dpr
Demo  Demos\InputOutput\BatchConvert\BatchConvert.dpr


Examples

Auto-Enhance - AutoImageEnhance1 Example
// Improve the contrast and colors in the image
// Same as: ImageEnView1.Proc.AutoImageEnhance1( 64, 20, 25, 2 );
Effect.Add( peAutoEnhance );
Effect.CurrentItem.AutoEnhance_Method   := AutoEnhanceMethod_AutoImageEnhance1;
Effect.CurrentItem.AutoEnhance1_Slope   := 20;
Effect.CurrentItem.AutoEnhance1_Range   := 25;
Effect.CurrentItem.AutoEnhance1_Quality := 5;  // Which affects SubsampledSize and Neighbour
Effect.Apply();

See also: AutoImageEnhance1

Auto-Enhance - AutoImageEnhance3 Example

// Enhance luminosity by applying a local adaptation tone mapping algorithm
// Same as: ImageEnView1.Proc.AutoImageEnhance3( 0.35, 80 );
Effect.Add( peAutoEnhance );
Effect.CurrentItem.AutoEnhance_Method      := AutoEnhanceMethod_AutoImageEnhance3;
Effect.CurrentItem.AutoEnhance3_Gamma      := 0.35;
Effect.CurrentItem.AutoEnhance3_Saturation := 80;
Effect.Apply();

See also: AutoImageEnhance3

Auto-Enhance - WallisFilter Example

// Apply a Wallis Filter to the image
// Same as: ImageEnView1.Proc.WallisFilter();
Effect.Add( peAutoEnhance );
Effect.CurrentItem.AutoEnhance_Method := AutoEnhanceMethod_WallisFilter;
// Only default parameters used for: AutoEnhanceMethod_WallisFilter, AutoEnhanceMethod_AdjustGainOffset, AutoEnhanceMethod_WhiteBalance_AutoWhite
Effect.Apply();

See also: WallisFilter, AdjustGainOffset, WhiteBalance_AutoWhite

Bump Map Example

// Apply a bump mapping effect to the image
// Same as: ImageEnView1.Proc.BumpMapping( 800, 600, 40, 30, 10, CreateRGB(255, 255, 255) );
Effect.Add( peBumpMap );
Effect.CurrentItem.BumpMap_Left   := 800;
Effect.CurrentItem.BumpMap_Top    := 400;
Effect.CurrentItem.BumpMap_Width  := 40;
Effect.CurrentItem.BumpMap_Height := 30;
Effect.CurrentItem.BumpMap_Col    := CreateRGB( 255, 255, 255 );
Effect.CurrentItem.BumpMap_Src    := 10;
Effect.CurrentItem.BumpMap_Auto   := False;
Effect.Apply();

See also: BumpMapping

Brightness Example

// Apply a darken filter
// Same as: ImageEnView1.Proc.IntensityRGBAll( -10, -10, -10 );
Effect.Add( peContrast );
Effect.CurrentItem.Contrast_Brightness := -10;
Effect.Apply();

See also: IntensityRGBAll

Contrast Example

// Increase the contrast
// Same as: ImageEnView1.Proc.Contrast( 50 );
Effect.Add( peContrast );
Effect.CurrentItem.Contrast_Contrast := 50;
Effect.Apply();

See also: Contrast

Color Curve Example

// Apply a color curve to the image
Effect.Add( peColorCurve );
Effect.CurrentItem.ColorCurve_CurvePoints := '0,0,112,73,255,255|0,0,255,255|0,0,255,255|0,0,255,255';
Effect.CurrentItem.ColorCurve_Channel     := ieccRGB
Effect.Apply();

See also: ApplyCurve

Cropping Example

// Crop 25% of all sides of the image
// Same as: ImageEnView1.Proc.Crop( bmp.Width div 4, bmp.Height div 4, MulDiv( bmp.Width, 3, 4 ), MulDiv( bmp, 3, 4 ));
Effect.Add( peCrop );
Effect.CurrentItem.Crop_Left   := bmp.Width div 4;
Effect.CurrentItem.Crop_Top    := bmp.Height div 4;
Effect.CurrentItem.Crop_Right  := bmp.Width div 4;
Effect.CurrentItem.Crop_Bottom := bmp.Height div 4;
Effect.Apply();

See also: Crop

Border Example

// Add a black border to the image
// Same as: ImageEnView1.Proc.ImageResize( 10, 10, 10, 10, 255, clBlack );
Effect.Add( peCrop );
Effect.CurrentItem.Crop_Left   := -10;
Effect.CurrentItem.Crop_Top    := -10;
Effect.CurrentItem.Crop_Right  := -10;
Effect.CurrentItem.Crop_Bottom := -10;
Effect.CurrentItem.Crop_BackgroundColor := clBlack;
Effect.Apply();

See also: ImageResize

Equalization Example

// Compress the color histogram
// Same as: ImageEnView1.Proc.HistEqualize( CreateRGB(50, 50, 50), CreateRGB(150, 150, 150) );
Effect.Add( peEqualize );
Effect.CurrentItem.Equalization_EqDown := CreateRGB( 50, 50, 50 );
Effect.CurrentItem.Equalization_EqUp := CreateRGB( 150, 150, 150 );
Effect.CurrentItem.Equalization_AutoEqualize := True;
Effect.Apply();

See also: HistEqualize

Equalization - AutoEqualize Example

// Equalizes the color histogram of the selected region
// Same as: ImageEnView1.Proc.HistAutoEqualize();
Effect.Add( peEqualize );
Effect.CurrentItem.Equalization_AutoEqualize := True;
Effect.Apply();

See also: HistAutoEqualize

Equalization - Threshold Example

// Change all values less than R/G/B of 64 to black
// Same as: ImageEnView1.Proc.Threshold( CreateRGB(64, 64, 64), CreateRGB(255, 255, 255), CreateRGB(0, 0, 0), CreateRGB(255, 255, 255) );
Effect.Add( peEqualize );
Effect.CurrentItem.Equalization_ThresholdDown := CreateRGB( 64, 64, 64 );
Effect.CurrentItem.Equalization_ThresholdUp := CreateRGB( 255, 255, 255 );
Effect.CurrentItem.Equalization_Gray  := True;
Effect.CurrentItem.Equalization_Blue  := False;
Effect.CurrentItem.Equalization_Green := False;
Effect.CurrentItem.Equalization_Red   := False;
Effect.Apply();

See also: Threshold

Gamma Correction Example

// Apply gamma correction over all channels (RGB)
// Same as: ImageEnView1.Proc.GammaCorrect( 2, [iecRed, iecGreen, iecBlue] );
Effect.Add( peGamma );
Effect.CurrentItem.GammaCorrection_Red   := True;
Effect.CurrentItem.GammaCorrection_Green := True;
Effect.CurrentItem.GammaCorrection_Blue  := True;
Effect.CurrentItem.GammaCorrection_Value := 2.0;
Effect.Apply();

See also: GammaCorrect

HSL Example

// Convert to gray
// Same as: ImageEnView1.Proc.HSLVar( 0, 100, 0 );
Effect.Add( peHSL );
Effect.CurrentItem.HSL_H := 0;
Effect.CurrentItem.HSL_S := -100;
Effect.CurrentItem.HSL_L := 0;
Effect.Apply();

See also: HSLvar

HSV Example

// Increase luminosity/brightness
// Same as: ImageEnView1.Proc.HSVvar(0, 0, 30);
Effect.Add( peHSV );
Effect.CurrentItem.HSV_H := 0;
Effect.CurrentItem.HSV_S := 0;
Effect.CurrentItem.HSV_V := 30;
Effect.Apply();

See also: HSVvar

Lens Effects Example

// Apply a lens effect to the center of the image
// Same as: ImageEnView1.Proc.Lens( bmp.Width div 2, bmp.Height div 2, bmp.Width, bmp.Height, 6 );
Effect.Add( peLens );
Effect.CurrentItem.Lens_Left   := bmp.Width,div 2;
Effect.CurrentItem.Lens_Top    := bmp.Height div 2;
Effect.CurrentItem.Lens_Width  := bmp.Width;
Effect.CurrentItem.Lens_Height := bmp.Height;
Effect.CurrentItem.Lens_Ref    := 6.0;
Effect.CurrentItem.Lens_Auto   := False;
Effect.Apply();

See also: Lens

Level Adjustment Example

// Shift the midpoint of the image to brighten it
// Same as: ImageEnView1.Proc.AdjustLevels( 0, 102, 201, 0, 255 );
Effect.Add( peLevels );
Effect.CurrentItem.Levels_Shadow       := 0;
Effect.CurrentItem.Levels_MidTone      := 102;
Effect.CurrentItem.Levels_Highlight    := 201;
Effect.CurrentItem.Levels_OutShadow    := 0;
Effect.CurrentItem.Levels_OutHighlight := 255;
Effect.Apply();

See also: AdjustLevels

Morphing - Opening Example

// Perform an erosion followed by a dilation
// Same as: ImageEnView1.Proc.Opening( 1 );
Effect.Add( peMorph );
Effect.CurrentItem.Morph_Filter  := MorphFilter_Opening;
Effect.CurrentItem.Morph_WinSize := 1;
Effect.Apply();

See also: Opening

Morphing - Closing Example

// Perform a dilation followed by an erosion
// Same as: ImageEnView1.Proc.Closing( 1 );
Effect.Add( peMorph );
Effect.CurrentItem.Morph_Filter  := MorphFilter_Closing;
Effect.CurrentItem.Morph_WinSize := 1;
Effect.Apply();

See also: Closing

Morphing - Minimum Example

// Set each pixel to the minimum value of all pixel values in the neighborhood
// Same as: ImageEnView1.Proc.Minimum( 1 );
Effect.Add( peMorph );
Effect.CurrentItem.Morph_Filter  := MorphFilter_Minimum;
Effect.CurrentItem.Morph_WinSize := 1;
Effect.Apply();

See also: Minimum

Morphing - Maximum Example

// Set each pixel to the maximum value of all pixel values in the neighborhood
// Same as: ImageEnView1.Proc.Maximum( 1 );
Effect.Add( peMorph );
Effect.CurrentItem.Morph_Filter  := MorphFilter_Maximum;
Effect.CurrentItem.Morph_WinSize := 1;
Effect.Apply();

See also: Maximum

Pixelization Example

// Apply pixelation to the selection (with blocks of 2% of image width+height)
// Same as: ImageEnView1.Proc.Pixelize( 0.02 );
Effect.Add( pePixelize );
Effect.CurrentItem.Pixelize_BlockSize := 0.02;
Effect.Apply();

See also: Pixelize

Resampling Example

// Resize the image so that it is no higher or wider than 100, but maintains the original aspect ratio
// Same as: ImageEnView1.Proc.Resample( 100, 100, rfLanczos3, True );
Effect.Add( peResize );
Effect.CurrentItem.Resize_ByPercent := False;
Effect.CurrentItem.Resize_Width  := 100;
Effect.CurrentItem.Resize_Height := 100;
Effect.CurrentItem.Resize_MaintainAR := True;
Effect.CurrentItem.Resize_QualityFilter := rfLanczos3;
Effect.Apply();

See also: Resample

Scaling Example

// Scale to half size
// Same as: ImageEnView1.Proc.Resample( 0.5, rfLanczos3 );
Effect.Add( peResize );
Effect.CurrentItem.Resize_ByPercent := True;
Effect.CurrentItem.Resize_Width  := 0.5;
Effect.CurrentItem.Resize_Height := 0.5;
Effect.CurrentItem.Resize_MaintainAR := True;
Effect.CurrentItem.Resize_QualityFilter := rfLanczos3;
Effect.Apply();

See also: Resample

RGB Example

// Apply a Red filter (subtracts the Green and Blue channels)
// Same as: ImageEnView1.Proc.IntensityRGBAll( 0, -255, -255 );
Effect.Add( peRGB );
Effect.CurrentItem.RGB_R := 0;
Effect.CurrentItem.RGB_G := -255;
Effect.CurrentItem.RGB_B := -255;
Effect.Apply();

See also: IntensityRGBAll

Rotate Example

// Rotate the image 45° clockwise at highest quality and make the non-image area transparent
// Same as: ImageEnView1.Proc.Rotate( -45, ierBicubic, clNone );
Effect.Add( peRotate );
Effect.CurrentItem.Rotate_Angle   := -45;
Effect.CurrentItem.Rotate_AndCrop := False;
Effect.CurrentItem.Rotate_BackgroundColor := clNone;
Effect.CurrentItem.Rotate_AntiAlias := ierBicubic;
Effect.Apply();

See also: Rotate

RotateAndCrop Example

// Rotate and crop a digital photo by 5 degrees
// Same as: ImageEnView1.Proc.RotateAndCrop( 5, ierBicubic, 0, iecaAngledPhoto );
Effect.Add( peRotate );
Effect.CurrentItem.Rotate_Angle   := 5;
Effect.CurrentItem.Rotate_AndCrop := True;
Effect.CurrentItem.Rotate_CropAlgorithm := iecaAngledPhoto;
Effect.CurrentItem.Rotate_AntiAlias := ierBicubic;
Effect.Apply();

See also: RotateAndCrop

Flip Example

// Flip horizontally
// Same as: ImageEnView1.Proc.Flip( fdHorizontal );
Effect.Add( peRotate );
Effect.CurrentItem.Flip_Horz := True;
Effect.CurrentItem.Flip_Vert := False;
Effect.Apply();

See also: Flip

Sharpen Example

// Apply a sharpening filter to the image
// Same as: ImageEnView1.Proc.Sharpen( 10, 4 );
Effect.Add( peSharpen );
Effect.CurrentItem.Sharpen_Sharpen := 10;
Effect.CurrentItem.Sharpen_Size    := 4;
Effect.Apply();

See also: Sharpen

Auto-Sharpen Example

// Automatically increase image sharpness by enhancing the contours of detected objects
// Same as: ImageEnView1.Proc.AutoSharp();
Effect.Add( peSharpen );
Effect.CurrentItem.Sharpen_Sharpen := 68;
Effect.CurrentItem.Sharpen_AutoSharp := True;
Effect.Apply();

See also: AutoSharp

Smoothing - SymmetricNearestNeighbour Example

// Apply a "Symmetric Nearest Neighbour" smoothing filter to the image
// Same as: ImageEnView1.Proc.SymmetricNearestNeighbour(6);
Effect.Add( peSmoothing );
Effect.CurrentItem.Smooth_Method := SmoothMethod_SymmetricNearestNeighbour;
Effect.CurrentItem.Smooth_Strength := 6;
Effect.Apply();

See also: SymmetricNearestNeighbour

Smoothing - Blur Example

// Apply a Gaussian Blur filter to reduce detail and noise
// Same as: ImageEnView1.Proc.Blur( 4 );
Effect.Add( peSmoothing );
Effect.CurrentItem.Smooth_Method := SmoothMethod_Blur;
Effect.CurrentItem.Smooth_Strength := 4;
Effect.Apply();

See also: Blur

Smoothing - UnsharpMask Example

// Apply a gaussian blur to the image
// Same as: ImageEnView1.Proc.UnsharpMask( 4 );
Effect.Add( peSmoothing );
Effect.CurrentItem.Smooth_Method:  := SmoothMethod_Unsharp;
Effect.CurrentItem.Smooth_Strength := 4;
Effect.Apply();

See also UnsharpMask

Smoothing - Denoising Example

// Perform image denoising using the Non-local Means Denoising algorithm
// Same as: ImageEnView1.IEBitmap.GetIEVisionImage().fastNlMeansDenoisingColored( 3, 3 );
Effect.Add( peSmoothing );
Effect.CurrentItem.Smooth_Method := SmoothMethod_fastNlMeansDenoisingColored;
Effect.CurrentItem.Smooth_Strength := 3;
Effect.Apply();

See also: fastNlMeansDenoisingColored

Smoothing - Bilateral Example

// Smooth image using Bilateral
// Same as: ImageEnView1.IEBitmap.GetIEVisionImage().smooth( ievBILATERAL, 5, 0, 30, 30 );
Effect.Add( peSmoothing );
Effect.CurrentItem.Smooth_Method := SmoothMethod_Smooth_Bilateral;
Effect.CurrentItem.Smooth_Strength := 3; // Smooth_Strength*10 is used for param3 and param4. Param1 is 5 for ievBILATERAL
Effect.Apply();

See also: smooth

Smoothing - Median Example

// Smooth image using Median
// Same as: ImageEnView1.IEBitmap.GetIEVisionImage().smooth( ievMEDIAN, 3 );
Effect.Add( peSmoothing );
Effect.CurrentItem.Smooth_Method := SmoothMethod_Smooth_Bilateral;
Effect.CurrentItem.Smooth_Strength := 3; // Smooth_Strength is used for param1 for ievBLUR, ievGAUSSIAN and ievMEDIAN. param2/3/4 are the default
Effect.Apply();

See also: smooth

Soft Shadow Example

// Add a shadow to the bottom-right of the image
// Same as: ImageEnView1.Proc.AddSoftShadow( 5, 4, iespBottomRight );
Effect.Add( peSoftShadow );
Effect.CurrentItem.Shadow_Color    := clBlack;
Effect.CurrentItem.Shadow_Position := iespBottomRight;  // or iespAll for Glow
Effect.CurrentItem.Shadow_Radius := 5;
Effect.CurrentItem.Shadow_Offset := 4;
Effect.Apply();

See also: AddSoftShadow

Inner Shadow Example

// Add a red shadow to the inner border of the image
// Same as: ImageEnView1.Proc.AddInnerShadow( 10, 0, 0, clRed );
Effect.Add( peSoftShadow );
Effect.CurrentItem.Shadow_Color    := clRed;
Effect.CurrentItem.Shadow_Position := iespInner;
Effect.CurrentItem.Shadow_Radius := 10;
Effect.CurrentItem.Shadow_Offset := 0;  // All sides
Effect.Apply();

See also: AddInnerShadow

User Filter Example

// Apply emboss filter
Const
  filter: TGraphFilter = ( Values: ( (-1, 0, 1), (-1, 1, 1), (-1, 0, 1) ); Divisor: 1 );
begin
  Effect.Add( peUserFilt );
  Effect.CurrentItem.UserFilter_Values := filter;
  Effect.Apply();
end;

See also: ApplyFilter

Other Color Methods - Colorize Example

// Colorize the image with a sepia look
// Same as: ImageEnView1.Proc.Colorize( 40, 50, 1.1 );
Effect.Add( peOtherColor );
Effect.CurrentItem.OtherColor_Method   := OtherColor_Colorize;
Effect.CurrentItem.Colorize_Hue        := 40;
Effect.CurrentItem.Colorize_Saturation := 50;
Effect.CurrentItem.Colorize_Luminosity := 1.1;
Effect.Apply();

See also: Colorize

Other Color Methods - Colorise Example

// Convert to gray levels
// Same as: ImageEnView1.Proc.ConvertToGray();
Effect.Add( peOtherColor );
Effect.CurrentItem.OtherColor_Method := OtherColor_ConvertToGray;
// Only default parameters used for: OtherColor_ConvertToGray, OtherColor_ConvertToSepia, OtherColor_Negative, OtherColor_WhiteBalance_GrayWorld
Effect.Apply();

See also: ConvertToGray, ConvertToSepia, Negative, WhiteBalance_GrayWorld

Other Effects - Wave Example

// Apply a wave effect to the image
// Same as: ImageEnView1.Proc.Wave( 10, 12, 0, false );
Effect.Add( peOtherEffects );
Effect.CurrentItem.OtherEffect_Method := OtherEffect_Wave;
Effect.CurrentItem.Wave_Amplitude  := 10;
Effect.CurrentItem.Wave_WaveLength := 12;
Effect.CurrentItem.Wave_Phase      := 0;
Effect.CurrentItem.Wave_Reflect    := False;
Effect.Apply();

See also: Wave

Other Effects - Pencil Sketch Example

// Transform image into a monochrome pencil sketch
// Same as: ImageEnView1.Proc.PencilSketch( True );
Effect.Add( peOtherEffects );
Effect.CurrentItem.OtherEffect_Method := OtherEffect_PencilSketch_Gray;
// Only default parameters used for: OtherEffect_PencilSketch_Gray, OtherEffect_PencilSketch_Color, OtherEffect_Reflection
Effect.Apply();

See also: PencilSketch, Reflection

Other Examples
// Display Effects Dialog with state saved between sessions
if FileExists( 'D:\State.dat' ) then
  ImageEnView1.Proc.IPDialogParams.LoadFromFile( 'D:\State.dat' );
ImageEnView1.Proc.DoPreviews( ppeSpecialEffects );
ImageEnView1.Proc.IPDialogParams.SaveToFile( 'D:\State.dat' );

// Default to the Rotate page
ImageEnView1.Proc.IPDialogParams.Operation := peRotate;
ImageEnView1.Proc.IPDialogParams.Rotate_Angle := 45;
ImageEnView1.Proc.DoPreviews( ppeEditingFunctions );

// Display the operation performed in the Previews dialog
if ImageEnView1.Proc.DoPreviews( ppeEditingFunctions ) then
  Caption := ImageEnView1.Proc.IPDialogParams.Description();

// Apply chain of editing operations to an image
var
  op: TIEImageEffect;
begin
  ImageEnView1.IO.LoadFromFile( 'D:\image.jpg' );
  ImageEnView1.IEBitmap.EffectsChain.Enabled := True;

  op := TIEImageEffect.Create();
  try
    // Reduce size by half
    op.Operation            := peResize;
    op.Resize_Width         := 50;
    op.Resize_Height        := 50;
    op.Resize_ByPercent     := True;
    op.Resize_QualityFilter := rfLanczos3;
    ImageEnView1.IEBitmap.EffectsChain.Add( op );

    // Enhance contrast
    op.Operation         := peContrast;
    op.Contrast_Contrast := 20;
    ImageEnView1.IEBitmap.EffectsChain.Add( op );

    // Rotate 45 deg. clockwise
    op.Operation              := peRotate;
    op.Rotate_Angle           := -45;
    op.Rotate_BackgroundColor := clBlack;
    op.Rotate_Antialias       := ierFast;
    ImageEnView1.IEBitmap.EffectsChain.Add( op );

    // Apply effects
    ImageEnView1.IEBitmap.EffectsChain.Apply();

    ImageEnView1.IO.SaveToFile( 'D:\image-Edit.jpg' );
  finally
    op.Free;
  end;
end;

// Prompt the user for an image editing effect and add it to our Effects Chain (TIEImageEffectsList)
op := TIEImageEffect.Create();
try
  if ImageEnView1.Proc.DoPreviews( ppeEditingFunctions, op ) then
  begin
    EffectsChain.Add( op );
    ListBox1.Items.Add( op.Description() );
  end;
finally
  op.Free;
end;