ImageEn, unit imageenproc

TImageEnProc


Declaration

TImageEnProc = class(TComponent);


Description

TImageEnProc provides image processing and analysis functionality to a TImageEnView, 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

ImageEnView1.Proc.Rotate(90);


2. Attached to a TBitmap or TIEBitmap in code

bmp := TBitmap.Create;
bmp.LoadFromFile('D:\image.bmp');
proc := TImageEnProc.CreateFromBitmap(bmp);
proc.Negative();
proc.Free;
bmp.Write('D:\output.bmp');
bmp.Free;


Demos

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


Examples

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




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




// Prompt to edit 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]);

// Load an image with a TIEBitmap, make it negative then save it
iebmp := TIEBitmap.Create;
proc := TImageEnProc.create(nil);
proc.AttachedIEBitmap := iebmp;
iebmp.Read('D:\animage.jpeg');
proc.Negative();
iebmp.Write('D:\output.jpeg');
proc.Free;
iebmp.Free;


Methods and Properties

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

Dialogs
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  CalcOrientation
Public Method  CalcStdDev
Public Method  CompareWith
Public Method  CompareHistogramWith
Public Method  ComputeImageEquality
Public Method  GetDominantColor
Public Method  GetCMYKChannels
Public Method  GetHistogram
Public Method  GetHSVChannelAll
Public Method  GetHSVChannel
Public Method  GetRGBChannelAll
Public Method  GetRGBChannel
Public Method  SeparateObjects

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

Automatic Image Enhancement
Public Method  AdjustGainOffset
Public Method  AutoImageEnhance1
Public Method  AutoImageEnhance2
Public Method  AutoImageEnhance3
Public Method  AutoSharp
Public Method  HistAutoEqualize
Public Method  WhiteBalance_AutoWhite
Public Method  WhiteBalance_GrayWorld

Color Adjustment
Public Method  AdjustBrightnessContrastSaturation
Public Method  AdjustLevels
Public Method  AdjustLumSatHistogram
Public Method  AdjustSaturation
Public Method  AdjustTemperature
Public Method  AdjustTint
Public Method  CastColorRange
Public Method  Closing
Public Method  Colorize
Public Method  Contrast
Public Method  Contrast2
Public Method  Contrast3
Public Method  ConvertTo24Bit
Public Method  ConvertToBW_FloydSteinberg
Public Method  ConvertToBWLocalThreshold
Public Method  ConvertToBWOrdered
Public Method  ConvertToBWThreshold
Public Method  ConvertToGray
Public Method  ConvertToPalette
Public Method  ConvertToSepia
Public Method  ConvertTo
Public Method  DisposeChannels
Public Method  Deinterlace
Public Method  EdgeDetect_ShenCastan
Public Method  EdgeDetect_Sobel
Public Method  GammaCorrect
Public Method  HistEqualize
Public Method  HSLvar
Public Method  HSVvar
Public Method  IntensityRGBAll
Public Method  Intensity
Public Method  MapGrayToColor
Public Method  Maximum
Public Method  MedianFilter
Public Method  MatchHSVRange
Public Method  Minimum
Public Method  Negative
Public Method  Opening
Public Method  Random
Public Method  SetFromRGBChannels
Public Method  Threshold
Public Method  Threshold2
Public Method  WallisFilter
Public Method  WhiteBalance_coef
Public Method  WhiteBalance_WhiteAt

Chroma Key
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

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  MakeTile
Public Method  PerspectiveDraw
Public Method  ProjectDraw
Public Method  RadialStretch
Public Method  Reflection
Public Method  Resample
Public Method  ResampleTo
Public Method  Rotate
Public Method  RotateAndCrop
Public Method  RoundImage
Public Method  ShiftChannel
Public Method  SkewDetectionFine
Public Method  SkewDetection

Noise
Public Method  RemoveIsolatedPixels
Public Method  RemoveNoise
Public Method  SymmetricNearestNeighbour

Paint
Public Method  CastColor (Flood Fill)
Public Method  ClearSel
Public Method  Clear
Public Method  Fill
Public Method  GradientFill
Public Method  PaintMark
Public Method  PaintPenMarker

Pixel Adjustment
Public Method  ApplyFilterPreset
Public Method  ApplyFilter
Public Method  Blur
Public Method  BumpMapping
Public Method  Convolve
Public Method  FiltersInitialDir
Public Method  Lens
Public Method  Merge
Public Method  MotionBlur
Public Method  RemoveRedEyes
Public Method  Pixelize
Public Method  PencilSketch
Public Method  Sharpen
Public Method  UnsharpMask
Public Method  Wave

Shadows
Public Method  AddInnerShadow
Public Method  AddSoftShadow (and Glow)

Steganography
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

Others
Published Property  AutoConvertFormat
Published Property  Background
Public Method  Create
Public Method  CreateFromBitmap
Public Method  GetReSel
Published Property  ImageEnVersion
Public Property  ProgressTask
Public Property  Selected
Public Property  SelectedRect
Public Method  TextOut
Public Method  Update


Events

Event  OnFinishWork
Event  OnPreview
Event  OnProgress
Event  OnSaveUndo