ImageEn

Preview of Analysis Methods


The "Every Method" editing demo allows you to preview 300 editing, analysis and effects methods.


Image Editing 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

 Test Images

ImageEnView1.IO.LoadFromFile( 'D:\ImageTest1.jpg' );

  


 CalcAverageRGB

// Return the average RGB values of the selection (with sample size of 100)
rgb := ImageEnView1.Proc.CalcAverageRGB( 100 );
s := format( 'Average RGB: %d, %d, %d', [ rgb.r, rgb.g, rgb.b ]);

ImageTest1.jpg: Average RGB: 138, 106, 86
ImageTest2.jpg: Average RGB: 245, 218, 144
ImageTest3.jpg: Average RGB: 102, 91, 82


 CalcDensityHistogram

// Draw density histograms for the image
GetMem(vertoHist, ImageEnView2.IEBitmap.Height * sizeof(integer));
GetMem(horzoHist, ImageEnView2.IEBitmap.Width * sizeof(integer));
ImageEnView1.Proc.CalcDensityHistogram( vertHisto, horzHisto, ImageEnView2.IEBitmap.Width, ImageEnView2.IEBitmap.Height );
ImageEnView2.IEBitmap.Canvas.Pen.Color := clNavy;
for i := 0 to ImageEnView2.IEBitmap.Width - 1 do
begin
  ImageEnView2.IEBitmap.Canvas.MoveTo( i, ImageEnView2.IEBitmap.Height );
  ImageEnView2.IEBitmap.Canvas.LineTo( i, ImageEnView2.IEBitmap.Height - horzHisto[i] );
end;
ImageEnView2.Update();
FreeMem( vertHist );
FreeMem( horzHist );

  


 CalcImageNumColors

// Return the number of colors found in the image
n := ImageEnView1.Proc.CalcImageNumColors();
s := format( 'Color count: %d', [ n ]);

ImageTest1.jpg: Color count: 62008
ImageTest2.jpg: Color count: 15910
ImageTest3.jpg: Color count: 21283


 CalcImagePalette

// Output 256 colors of the image
ImageEnView1.Proc.CalcImagePalette( MyColorMap256, 256 );
IEDrawColorPalette( ImageEnView1.IEBitmap, MyColorMap256, 30, 30, 16 );




 CalcImageTransparency

// Return the percentage of pixels that are partially or fully transparent
ImageEnView1.Proc.SetTransparentColors( CreateRGB(192, 192, 192), CreateRGB(255, 255, 255), 0 ); // Make colors similar to white transparent
d := ImageEnView1.Proc.CalcImageTransparency();
s := format( 'Image Transparency: %d%%', [ Round( d * 100 )]);

  

ImageTest1.jpg: Image Transparency: 2%
ImageTest2.jpg: Image Transparency: 45%
ImageTest3.jpg: Image Transparency: 9%


 CalcStdDev

// Return the Standard Deviation of the image
d := ImageEnView1.Proc.CalcStdDev();
s := 'Standard Deviation: ' + FloatToStr( d );

ImageTest1.jpg: Standard Deviation: 59.55442
ImageTest2.jpg: Standard Deviation: 66.16412
ImageTest3.jpg: Standard Deviation: 78.59620


 GetDominantColor

// Return the most common color in the image (and its percentage of the image)
d := ImageEnView1.Proc.GetDominantColor( rgb );
s := format( 'Dominant Color (%d%%): %s', [ Round( d ), ColorToHex( TRGB2TColor( rgb )) ]);

ImageTest1.jpg: Dominant Color (0%): #060606
ImageTest2.jpg: Dominant Color (39%): #FFFFFF
ImageTest3.jpg: Dominant Color (20%): #1C1C1C

// Show in ImageEnView2 the 64 most common colors of the image in ImageEnView1
var
  domColors: Array of TColor;
  count: Integer;
begin
  SetLength( domColors, 64 );
  count := ImageEnView1.Proc.GetDominantColor( domColors, v1 );
  if count < v1 then
    SetLength( domColors, count ); // Image had less than 64 colors (only needed if you want to do something with domColors)
  IEDrawColorPalette( ImageEnView2.IEBitmap, domColors, 30, 30, 8, clWhite, clBlack, count );
  ImageEnView2.Update();
end;

  


 GetCMYKChannels

// Return the Cyan channel of the image
bmp1 := ImageEnView1.Proc.GetCMYKChannels( CMYK_C );

  

// Return the Magenta channel of the image
bmp1 := ImageEnView1.Proc.GetCMYKChannels( CMYK_M );

  

// Return the Yellow channel of the image
bmp1 := ImageEnView1.Proc.GetCMYKChannels( CMYK_Y );

  

// Return the Key (black) channel of the image
bmp1 := ImageEnView1.Proc.GetCMYKChannels( CMYK_K );

  


 GetHistogram

// Output the histogram of the gray-scale level
hist := ImageEnView1.Proc.GetHistogram( [hkGray] );
IEDrawHistogramToBitmap( hist, bmp, ImageEnView2.ClientWidth, ImageEnView2.ClientHeight,
                         [hkGray], hsFilledLines, iehsLinearClipped );
ImageEnView2.Update();

  

// Output the histogram of the RGB level
hist := ImageEnView1.Proc.GetHistogram( [hkRed, hkGreen, hkBlue] );
IEDrawHistogramToBitmap( hist, bmp, ImageEnView2.ClientWidth, ImageEnView2.ClientHeight,
                         [hkRed, hkGreen, hkBlue], hsFilledLines, iehsLinearClipped );
ImageEnView2.Update();

  

// Output the histogram of the hue level
Hist := ImageEnView1.Proc.GetHistogram( [hkHue] );
IEDrawHistogramToBitmap( hist, bmp, ImageEnView2.ClientWidth, ImageEnView2.ClientHeight,
                         [hkHue], hsFilledLines, iehsLinearClipped );
ImageEnView2.Update();

  


 GetHSVChannel

// Return the Hue channel of the image
bmp1 := ImageEnView1.Proc.GetHSVChannel( HSV_Hue );

  

// Return the Saturation channel of the image
bmp1 := ImageEnView1.Proc.GetHSVChannel( HSV_Sat );

  

// Return the Value channel of the image
bmp1 := ImageEnView1.Proc.GetHSVChannel( HSV_Val );

  


 GetRGBChannel

// Return the Red channel of the image
bmp1 := ImageEnView1.Proc.GetRGBChannel( iecRed );

  

// Return the Green channel of the image
bmp1 := ImageEnView1.Proc.GetRGBChannel( iecGreen );

  

// Return the Blue channel of the image
bmp1 := ImageEnView1.Proc.GetRGBChannel( iecBlue );

  



See Also

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