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
| Enabled: Boolean; |
| Operation: TPreviewEffect; |
| DialogWidth: Integer; |
| DialogLeft: Integer; |
| DialogTop: Integer; |
| DialogHeight: Integer; |
Effect Fields
Auto Enhancement (peAutoEnhance) | AutoEnhance_Method: Integer; (See AutoEnhance Method Constants) |
| AutoEnhance1_Slope: Integer; |
| AutoEnhance1_Range : Integer; |
| AutoEnhance1_Quality : Integer; |
| AutoEnhance3_Gamma : Double; |
| AutoEnhance3_Saturation : Integer; |
Uses one of: AutoImageEnhance1, AutoImageEnhance3, AdjustGainOffset, WallisFilter, WhiteBalance_AutoWhite
Bump Map (peBumpMap) | BumpMap_Left: Integer; |
| BumpMap_Top: Integer; |
| BumpMap_Width: Integer; |
| BumpMap_Height: Integer; |
| BumpMap_Col: TRGB; |
| BumpMap_Src: Integer; |
| BumpMap_Auto: Boolean; |
Uses BumpMapping
Color Curve (peColorCurve)Uses ApplyCurve
Contrast and Brightness (peContrast) | Contrast_Contrast: Integer; |
| Contrast_Brightness: Integer; |
Uses Contrast, or IntensityRGBAll for brightness
Cropping (peCrop) | Crop_Left : Integer; |
| Crop_Top : Integer; |
| Crop_Right : Integer; |
| Crop_Bottom : Integer; |
| Crop_BackgroundColor : TColor; |
| Crop_Shape : TIEShape; |
| Crop_LockAspectRatio: Double; |
Uses Crop, or ImageResize if Crop values are negative
Equalization (peEqualize) | Equalization_ThresholdDown: TRGB; |
| Equalization_ThresholdUp: TRGB; |
| Equalization_EqDown: TRGB; |
| Equalization_EqUp: TRGB; |
| Equalization_AutoEqualize: Boolean; |
| Equalization_Gray: Boolean; |
| Equalization_Blue: Boolean; |
| Equalization_Green: Boolean; |
| Equalization_Red: Boolean; |
Uses Threshold, HistEqualize and HistAutoEqualize (if Equalization_AutoEqualize is true)
Fourier Transformation (peFFT) | FFT_Left: Integer; |
| FFT_Top: Integer; |
| FFT_Right: Integer; |
| FFT_Bottom: Integer; |
| FFT_GrayScale: Boolean; |
| FFT_Selection: TMemoryStream; |
Uses FTConvertFrom
Gamma Correction (peGamma) | GammaCorrection_Red: Boolean; |
| GammaCorrection_Green: Boolean; |
| GammaCorrection_Blue: Boolean; |
| GammaCorrection_Value: Double; |
Uses GammaCorrect
HSL (peHSL) | HSL_H: Integer; |
| HSL_S: Integer; |
| HSL_L: Integer; |
Uses HSLvar
HSV (peHSV) | HSV_H: Integer; |
| HSV_S: Integer; |
| HSV_V: Integer; |
Uses HSVvar
Lens Effect (peLens) | Lens_Left: Integer; |
| Lens_Top: Integer; |
| Lens_Width: Integer; |
| Lens_Height: Integer; |
| Lens_Ref: Double; |
| Lens_Auto: Boolean; |
Uses Lens
Level Adjustment (peLevels) | Levels_Shadow: Byte; |
| Levels_MidTone: Byte; |
| Levels_Highlight: Byte; |
| Levels_OutShadow: Byte; |
| Levels_OutHighlight: Byte; |
Uses AdjustLevels
Morph Filter (peMorph)Uses Minimum, Maximum, Opening and Closing
Pixelization (pePixelize) | Pixelize_BlockSize: Double; |
Uses Pixelize
Resampling/Scaling (peResize) | Resize_ByPercent: Boolean; |
| Resize_Height: Double; |
| Resize_MaintainAR: Boolean; |
| Resize_QualityFilter: TResampleFilter; |
| 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) | RGB_R: Integer; |
| RGB_G: Integer; |
| RGB_B: Integer; |
Uses IntensityRGBAll
Rotate and Flip (peRotate) | Rotate_Angle: Double; |
| Rotate_AndCrop: Boolean; |
| Rotate_CropAlgorithm: TIECropAlgorithm; |
| Rotate_BackgroundColor: TColor; |
| Rotate_AntiAlias: TIEAntialiasMode; |
| Flip_Horz: Boolean; |
| Flip_Vert: Boolean; |
Uses Rotate, RotateAndCrop or Flip
Sharpen (peSharpen) | Sharpen_Sharpen: Integer; |
| Sharpen_Size: Integer; |
| Sharpen_AutoSharp: Boolean; |
Uses Sharpen, or AutoSharp if Sharpen_AutoSharp = true
Soft Shadow (peSoftShadow) | Shadow_Color : TColor; |
| Shadow_Position: TIEShadowPosition; |
| Shadow_Radius : Integer; |
| Shadow_Offset : Integer; |
Uses AddSoftShadow, or AddInnerShadow if Shadow_Position = iespInner
Smooth (peSmoothing) Uses one of: SymmetricNearestNeighbour, Blur, UnsharpMask, fastNlMeansDenoisingColored, smooth
User Filter (peUserFilt)Uses ApplyFilter
Transparency (peTransparency) | Transparency_Method: Integer; (See Transparency Method Constants) |
| Transparency_OriginX: Integer; |
| Transparency_OriginY: Integer; |
| Transparency_SourceColor: TColor; |
| Transparency_ColorTolerance: Integer; |
| Transparency_MaxFilter: Boolean; |
| Transparency_ChromaTolerance: Double; |
| Transparency_ChromaSaturation: Integer; |
| Transparency_ChromaFeathering: Integer; |
Uses one of: CastAlpha, SetTransparentColors, RemoveChromaKey
Other Color Methods (peOtherColor) | OtherColor_Method: Integer; (See Other Color Method Constants) |
| Colorize_Hue: Integer; |
| Colorize_Saturation: Integer; |
| Colorize_Luminosity: Double; |
Uses one of: ConvertToGray, ConvertToSepia, Colorize, Negative, WhiteBalance_GrayWorld
Other Effects (peOtherEffects) | OtherEffect_Method: Integer; (See Other Effect Constants) |
| Cartoonify_LineColor: TColor; |
| Cartoonify_Overlay: Boolean; |
| Cartoonify_Radius: Integer; |
| Cartoonify_RemoveNoiseSize: Integer; |
| Swirl_Left: Integer; |
| Swirl_Top: Integer; |
| Swirl_Radius: Integer; |
| Swirl_Twists: Double; |
| Wave_Amplitude: Integer; |
| Wave_WaveLength: Integer; |
| Wave_Phase: Integer; |
| Wave_Reflect: Boolean; |
Uses one of: Wave, Reflection, PencilSketch, Swirl, Cartoonify
Other
| Demos\ImageEditing\EffectsChain\EffectsChain.dpr |
| Demos\InputOutput\BatchConvert\BatchConvert.dpr |
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, Swirl, Cartoonify
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;