ImageEn, unit imageenproc

TImageEnProc

Properties · Methods · Events · Demos · Examples

Declaration

TImageEnProc = class(TComponent);


Description

TImageEnProc provides image processing and analysis functionality to a TImageEnView, TImageEnMView, TIEBitmap, TImage or TBitmap component. It also handles clipboard operations, undo/redo and encryption.



Generally you will not add a TImageEnProc component directly to your project. It is accessed via the following methods:

1. Using the Proc property of a TImageEnView

// Apply pixelization to the selected area of the image (or whole image if there is no selection)
ImageEnView1.Proc.Pixelize();


2. Using the Proc property of a TImageEnMView

// Rotate the selected image 90 deg.
ImageEnView1.Proc.Rotate();


3. Using the Proc helper property of a TIEBitmap, TIEMultiBitmap, TBitmap or TImage

// Enhance luminosity of an image
bmp.Proc.AutoImageEnhance3();


4. Attached to a TBitmap or TIEBitmap in code

// Load an image rotate it 270 deg. clockwise and then save it
iebmp := TIEBitmap.Create;
iebmp.LoadFromFile('D:\image.jpeg');
proc := TImageEnProc.CreateFromBitmap(iebmp);
proc.Rotate(90);
proc.Free;
iebmp.SaveToFile('D:\output.jpeg');
iebmp.Free;

Note:
Pre-built UI is available for most TImageEnProc methods, either as a dialog by calling DoPreviews or a TWinControl component using TIEEditControls.
To batch perform effects, editing and color operations use an EffectsChain


Preview of All Methods

Analysis Methods
Color Adjustment Methods
Color Depth Methods
Detection Methods
Effects Methods
Filter Methods
Geometric Methods
Painting and Alpha Methods
Smoothing Methods
Other Methods
Interactive Tools

Demos


Demo Description Demo Project Folder Compiled Demo
All Editing and Effects Methods Preview 300 effects, analysis and editing methods in a single demo

ImageEditing\EveryMethod\EveryMethod.dpr   
Automatic orientation Using SkewDetection to automatically rotate poorly scanned images ImageAnalysis\Orientator\Orientator.dpr   
Batch Converter Resize, Rotate, edit and convert a folder of images InputOutput\BatchConvert\BatchConvert.dpr   
Color Density Analysis Calculate the pixel density within an image ImageAnalysis\DensityAnalysis\DensityAnal.dpr   
Color Histogram Display histograms of the color density within an image ImageAnalysis\Histogram\Histogram.dpr   
Draw Text and Borders Adding text and borders to an image ImageEditing\DrawText\DrawText.dpr   
Fourier Transformation Create a Fourier Transformation for an image ImageAnalysis\FFT\FFT.dpr   
Image Similarity Use an algorithm to determine the similarity of two images ImageAnalysis\Compare\Compare.dpr   
Separate Objects Detect and separate all objects in an image ImageAnalysis\SeparateObjects\SeparateObjects.dpr   
Show Image Differences Calculate and display the differences between two images ImageAnalysis\ImagesDiff\ImagesDiff.dpr   
Add Border Add a border to an image ImageEditing\AddBorder\AddBorder.dpr   
Automatic Enhancement Various algorithms to automatically adjust the color of an image \ImageEditing\AutoEnhance\AutoAdjust.dpr   
Chroma Key Removal Remove the Chroma Key background from an image (e.g. a subject in front of a "Green-Screen") ImageEditing\ChromaKey\ChromaKey.dpr   
Dithering Reduction of colors in an image and dithering methods ImageEditing\Dithering\Dithering.dpr   
Effects Chain Editor Apply a series of image editing and color effects to an image ImageEditing\EffectsChain\EffectsChain.dpr   
Image Resizing Resizing an image to keep only a portion of it (Note: does not demonstrate stretching/scaling) ImageEditing\Resize\Resize.dpr   
Lens Effect Demo of the Lens effect ImageEditing\Lens\LensTest.dpr   
Lossless JPEG Editing Perform a lossless crop and rotation of a JPEG (i.e. no quality loss due to re-saving) ImageEditing\LosslessJpegEdit\Lossless.dpr   
Pencil Sketch Effect Using PencilSketch to convert an image to a pencil sketch ImageEditing\PencilSketch\PencilSketch.dpr   
Radial Effect Using RadialStretch to correct barrel or pincushion distortion ImageEditing\Radial\RadialStretch.dpr   
Remove Red Eyes Removing the "Red Eye" effect from flash photos ImageEditing\RedEye\RedEye.dpr   
Rotate and Crop Automatic cropping of borders using RotateAndCrop ImageEditing\RotateAndCrop\RotateAndCrop.dpr   
RGB Channels View and edit the red, green and blue channels of an image ImageEditing\RGBChannels\RGBChannels.dpr   
Set Transparency Set the alpha (transparency) in an image by color or selection ImageEditing\MakeTransparent\MakeTransparent.dpr   
Soft Shadow Adding a soft shadow to an image ImageEditing\SoftShadow\SoftShadow.dpr   
Undo/Redo Using Undo and Redo to step back though image changes ImageEditing\UndoRedo\UndoRedo.dpr   
Warp Brush Click and drag the image to freely warp its content ImageEditing\WarpBrush\WarpBrush.dpr   
Image Encryption Encryption and decryption of images using 128bit TEA algorithm InputOutput\Encrypt\Encrypt.dpr   
Threaded Processing Loading images and applying effects in a background thread using the TTask class ImageEditing\ThreadedProcessing\ThreadTest.dpr   
Threaded Processing 2 Improving image processing performance using TParallel.For ImageEditing\ThreadedProcessing2\ThreadTest.dpr   
Complete Editor Complete image editing application showing many key features ImageEditing\CompleteEditor\PhotoEn.dpr   
All Actions Demo showing all ImageEn actions (400+) available to rapidly build applications Actions\AllActions\AllActions.dpr   

Examples


// Prompt user to perform color adjustment on the current image
ImageEnView1.Proc.DoPreviews( ppeColorAdjustments );




// Prompt user to perform image effects on the current image
ImageEnView1.Proc.DoPreviews( ppeSpecialEffects );




// Prompt user to perform editing operations the current image
ImageEnView1.Proc.DoPreviews( ppeEditingFunctions );




// Rotate an image in a TImageEnView 90° clockwise
ImageEnView1.Proc.Rotate(270);

// Reduce the size of an image in a TImageEnView to half its size (so when saved it will be much smaller on disk)
ImageEnView1.Proc.Resample(ImageEnView1.IEBitmap.Width div 2, -1, rfLanczos3);

// Prompt the user to perform image effects on an image in a TImage
ImageEnView1.Proc.AttachedBitmap := Image1.Picture.Bitmap;
ImageEnView1.Proc.DoPreviews([peAll]);

// Increase contrast of bitmap rectangle (0,0,49,49)
ImageEnView1.SelectionBase := iesbBitmap;
ImageEnView1.Select(0, 0, 50, 50);
ImageEnView1.Proc.Contrast(10);
ImageEnView1.Deselect();

// Load an image with a TBitmap, make it negative then save it
bmp := TBitmap.Create;
bmp.LoadFromFile('D:\image.bmp');
proc := TImageEnProc.CreateFromBitmap(bmp);
proc.Negative();
proc.Free;
bmp.SaveToFile('D:\output.bmp');
bmp.Free;

Methods and Properties


Connected Component
Public Property  AttachedBitmap
Public Property  AttachedIEBitmap
Published Property  AttachedImageEn
Published Property  AttachedTImage

Editing and Effects Dialog
Public Method  ApplyPreviews
Public Method  DoPreviews
Public Property  IPDialogParams
Published Property  PreviewFont
Published Property  PreviewFontEnabled
Public Property  PreviewsLog
Published Property  PreviewsParams

Analysis
Public Method  CalcAverageRGB
Public Method  CalcDensityHistogram
Public Method  CalcImageNumColors
Public Method  CalcImagePalette
Public Method  CalcImageTransparency
Public Method  CalcOrientation
Public Method  CalcStdDev
Public Method  CompareWith
Public Method  CompareHistogramWith
Public Method  ComputeImageEquality
Public Method  GetDominantColor
Public Method  GetCMYKChannels
Public Method  GetHistogram
Public Method  GetHSVChannel
Public Method  GetRGBChannel
Public Method  SeparateObjects
Public Method  SkewDetectionFine
Public Method  SkewDetection

Alpha Channel
Public Method  AlphaFill
Public Method  CastAlpha
Public Method  FeatherAlphaEdges
Public Method  SetTransparentColors

Color Adjustment
Public Method  AdjustGainOffset
Public Method  AdjustBrightnessContrastSaturation
Public Method  AdjustLevels
Public Method  AdjustLumSatHistogram
Public Method  AdjustSaturation
Public Method  AdjustTemperature
Public Method  AdjustTint
Public Method  ApplyCubeLUT
Public Method  AutoImageEnhance1
Public Method  AutoImageEnhance2
Public Method  AutoImageEnhance3
Public Method  Colorize
Public Method  Contrast
Public Method  Contrast2
Public Method  Contrast3
Public Method  ConvertToGray
Public Method  ConvertToSepia
Public Method  DisposeChannels
Public Method  GammaCorrect
Public Method  HistAutoEqualize
Public Method  HistEqualize
Public Method  HSLvar
Public Method  HSVvar
Public Method  IntensityRGBAll
Public Method  Intensity
Public Method  MatchHSVRange
Public Method  Negative
Public Method  SetFromRGBChannels
Public Method  Threshold
Public Method  WallisFilter
Public Method  WhiteBalance_AutoWhite
Public Method  WhiteBalance_Coef
Public Method  WhiteBalance_GrayWorld
Public Method  WhiteBalance_WhiteAt

Color Depth Adjustment
Public Method  ConvertTo
Public Method  ConvertTo24Bit
Public Method  ConvertToBW_FloydSteinberg
Public Method  ConvertToBWLocalThreshold
Public Method  ConvertToBWOrdered
Public Method  ConvertToBWThreshold
Public Method  ConvertToPalette

Color Fill and Painting
Public Method  CastColor (Flood Fill)
Public Method  CastColorRange
Public Method  ClearSel
Public Method  Clear
Public Method  Fill
Public Method  GradientFill
Public Method  MapGrayToColor
Public Method  PaintMark
Public Method  Random

Chroma Key Color Removal
Public Method  GuessChromaKeyColor
Public Method  RemoveChromaKey

Clipboard
Public Method  CanCutToClipboard
Public Method  CutToClipboard
Public Method  CanCopyToClipboard
Public Method  CopyToClipboard
Public Method  CanPasteFromClipboard
Public Method  PasteFromClipboard
Public Method  PointPasteFromClip

Effects
Public Method  AddInnerShadow
Public Method  AddSoftShadow (and Glow)
Public Method  BumpMapping
Public Method  Cartoonify
Public Method  Lens
Public Method  Pixelize
Public Method  PencilSketch
Public Method  Reflection
Public Method  Swirl
Public Method  Wave

Encryption
Public Method  Decrypt
Public Method  Encrypt

Fourier Analysis (FFT)
Public Method  FTClearZone
Public Method  FTConvertFrom
Public Method  FTCreateImage
Public Method  FTDisplayFrom

Geometric (Rotate, resize, crop, etc)
Public Method  AutoCrop
Public Method  AutoCrop2
Public Method  CropTransparentBorder
Public Method  CropSel
Public Method  Crop
Public Method  Flip
Public Method  ImageResize
Public Method  JoinBitmaps
Public Method  PerspectiveDraw
Public Method  ProjectDraw
Public Method  RadialStretch
Public Method  Resample
Public Method  ResampleTo
Public Method  Rotate
Public Method  RotateAndCrop
Public Method  RoundImage
Public Method  ShiftChannel
Public Method  Warp

Morphological and Filters
Public Method  ApplyFilterPreset
Public Method  ApplyFilter
Public Method  Closing
Public Method  Convolve
Public Method  FiltersInitialDir
Public Method  Maximum
Public Method  MedianFilter
Public Method  Minimum
Public Method  Opening

Noise, Sharpening and Blur
Public Method  AutoSharp
Public Method  Blur
Public Method  MotionBlur
Public Method  RemoveIsolatedPixels
Public Method  RemoveNoise
Public Method  Sharpen
Public Method  SymmetricNearestNeighbour
Public Method  UnsharpMask

Other Editing
Public Method  EdgeDetect_ShenCastan
Public Method  EdgeDetect_Sobel
Public Method  MakeTile
Public Method  Merge
Public Method  RemoveRedEyes
Public Method  TextOut
Public Method  TextOutEx

Steganography (Hidden Text)
Public Method  ClearHiddenText
Public Method  GetHiddenDataSpace
Public Method  ReadHiddenData
Public Method  ReadHiddenText
Public Method  WriteHiddenData
Public Method  WriteHiddenText

Transitions
Public Method  PrepareTransitionBitmaps
Public Method  CreateTransitionBitmap

Undo
Published Property  AutoUndo
Public Property  CanUndo
Public Method  ClearAllUndo
Public Method  ClearUndoAt
Public Method  ClearUndo
Public Method  GetUndoInfo
Public Method  SaveUndo
Public Method  Undo
Public Method  UndoAt
Public Property  UndoCaptions
Public Property  UndoCount
Published Property  UndoLimit
Public Property  UndoLocation
Public Method  UndoRect

Redo
Public Property  CanRedo
Public Method  ClearAllRedo
Public Method  ClearRedo
Public Method  ClearRedoAt
Public Method  GetRedoInfo
Public Method  Redo
Public Method  RedoAt
Public Property  RedoCaptions
Public Property  RedoCount
Public Method  SaveRedo

Custom Image Analysis
Public Method  BeginImageAnalysis
Public Method  EndImageAnalysis

Custom Image Processing
Public Method  BeginImageProcessing
Public Method  EndImageProcessing

Other
Published Property  AutoConvertFormat
Published Property  Background
Public Method  Create
Public Method  CreateFromBitmap
Public Method  Deinterlace
Public Method  GetReSel
Published Property  ImageEnVersion
Public Property  ProgressTask
Public Property  Selected
Public Property  SelectedRect
Public Method  Update

 Method is an automatic adjustment


Events

Event  OnFinishWork
Event  OnPreview
Event  OnProgress
Event  OnSaveUndo
Event  OnUndoRedo