Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   7.6    Statistic  

GMImage.Compare

Compares current image with another image.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
GraphicsMagick 2.0 Yes Yes Yes Yes Yes

MBS( "GMImage.Compare"; ImageRef; OtherImageRef )

Parameters

Parameter Description Example value
ImageRef The image reference number. 1
OtherImageRef The image reference number. 1

Result

Returns true if equal and false if not equal.

Description

Compares current image with another image.
Sets meanErrorPerPixel, normalizedMaxError, and normalizedMeanError in the current image. False is returned if the images are identical.

Examples

Compare images:

Set Variable [$img1; Value:MBS( "GMImage.NewFromContainer"; test::Container1 )]
Set Variable [$img2; Value:MBS( "GMImage.NewFromContainer"; test::Container2 )]
Set Variable [$result; Value:MBS( "GMImage.Compare"; $img1; $img2 )]
If [$result = 1]
    Show Custom Dialog ["Image Comparison"; "equal"]
Else If [$result = 0]
    Set Variable [$e; Value:MBS( "GMImage.NormalizedMaxError"; $img1 )]
    If [$e ≠ 0 and $e < ,03]
        Show Custom Dialog ["Image Comparison"; "very similar: " & MBS( "GMImage.NormalizedMaxError"; $img1 )]
    Else
        Show Custom Dialog ["Image Comparison"; "not equal"]
    End If
End If
Set Variable [$r; Value:MBS("GMImage.Destroy"; $img1)]
Set Variable [$r; Value:MBS("GMImage.Destroy"; $img2)]

See also


GMImage.Columns   -   GMImage.Composite

Feedback: Report problem or ask question.




Links
MBS FileMaker blog