.. index:: 
  !DocumentImage.compare Method
  
.. _id3_document_document_image_compare_class_method:

===============================================================================
DocumentImage.compare Method
===============================================================================

Module: :ref:`DocumentImage<id3_document_document_image_class>`

Definition
----------

Computes the difference with another image.


.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        compare(self, cmp_document_image: DocumentImage) -> float

      **Parameters**

        .. line-block::

          ``cmp_document_image`` :ref:`DocumentImage<id3_document_document_image_class>`
          :guilabel:`in` The image to compare.


      **Returns**

        .. line-block::

          ``float``
          Comparison result in percent (0% is same, 100% is full different).

      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        double compare(DocumentImage cmpDocumentImage)

      **Parameters**

        .. line-block::

          ``cmpDocumentImage`` :ref:`DocumentImage<id3_document_document_image_class>`
          :guilabel:`in` The image to compare.


      **Returns**

        .. line-block::

          ``double``
          Comparison result in percent (0% is same, 100% is full different).

      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public float Compare(DocumentImage cmpDocumentImage)

      **Parameters**

        .. line-block::

          ``cmpDocumentImage`` :ref:`DocumentImage<id3_document_document_image_class>`
          :guilabel:`in` The image to compare.


      **Returns**

        .. line-block::

          ``float``
          Comparison result in percent (0% is same, 100% is full different).

      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public float compare(DocumentImage cmpDocumentImage) throws DocumentException

      **Parameters**

        .. line-block::

          ``cmpDocumentImage`` :ref:`DocumentImage<id3_document_document_image_class>`
          :guilabel:`in` The image to compare.


      **Returns**

        .. line-block::

          ``float``
          Comparison result in percent (0% is same, 100% is full different).

      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public func compare(cmpDocumentImage: DocumentImage) throws -> Float

      **Parameters**

        .. line-block::

          ``cmpDocumentImage`` :ref:`DocumentImage<id3_document_document_image_class>`
          :guilabel:`in` The image to compare.


      **Returns**

        .. line-block::

          ``Float``
          Comparison result in percent (0% is same, 100% is full different).

      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: C
      :sync: C

      .. code:: C

        int id3DocumentImage_Compare (
            ID3_DOCUMENT_IMAGE hDocumentImage, 
            ID3_DOCUMENT_IMAGE hCmpDocumentImage, 
            float * result)

      **Parameters**

        .. line-block::

          ``hDocumentImage`` :ref:`ID3_DOCUMENT_IMAGE<id3_document_document_image_class>`
          :guilabel:`in` Handle to the DocumentImage object.

          ``hCmpDocumentImage`` :ref:`ID3_DOCUMENT_IMAGE<id3_document_document_image_class>`
          :guilabel:`in` The image to compare.

          ``result`` float *
          :guilabel:`out` Comparison result in percent (0% is same, 100% is full different).


      **Returns**

        .. line-block::

          ``int``
          An error code.
          See :ref:`id3DocumentError<id3_document_document_error_enum>` file for the list of possible error codes.


