ImageEn, unit iexBitmaps

TIEBitmap.GetHash

TIEBitmap.GetHash

Declaration

function GetHash(Algorithm: TIEHashAlgorithm = iehaMD5; SamplesCount: Integer = 0; IncludeAlpha: Boolean = False): AnsiString;

Description

Calculates the hash (using the specified hash algorithm) of the bitmap and returns the string representation of the hash.
SamplesCount specifies how many samples of the image are used to compute the hash. 0 = Entire image.
If IncludeAlpha is enabled, the alpha channel is also included in the hash. Otherwise, it is ignored.

Demo

Demo  Demos\ImageEditing\EveryMethod\EveryMethod.dpr

Examples

Also see: Automated Samples
// Calculate MD5 hash of input.jpg raster bitmap
ImageEnView1.IO.LoadFromFile('input.jpg');
ShowMessage( ImageEnView1.IEBitmap.GetHash() );


// Return a SHA-512 hash of the image pixels
ImageEnView1.IO.LoadFromFile('ImageTest1.jpg');
ShowMessage( ImageEnView1.IEBitmap.GetHash( iehaSHA512, 0, False );

 
Hash of ImageTest1.jpg: 3f2857fd695eb3d8495fc5b5db9db2a292492861822911c6a90d77f02bc561199ea8ad3fd82215f5c94edc69274a83d06a21ac7a28fb38f7d015b19ced47aad3

See Also

◼GetPerceptualHash
◼CompareWith
◼TIEVisionImageHasher