Documentation
Table of contents

GrayscaleTransformationModes

Parameter GrayscaleTransformationModes are used to control whether or not to invert the color of the grayscale image. Generally, we think of the lighter colors as the background and the darker colors as the target in a grayscale image. However in a few cases it is opposite.

Example

{
    "GrayscaleTransformationModes": [
        {
            "Mode": "GTM_ORIGINAL"
        },
        {
            "Mode": "GTM_INVERTED" 
        }
    ]
}

Parameter Summary

Mode Arguments

Parameter GrayscaleTransformationModes consist of a group of grayscale transformation mode objects. Each grayscale transformation mode object includes a candidate mode and a series of mode arguments. The mode arguments of the grayscale transformation mode object is shown as follow:

Mode Argument Name Mode Argument Summary
Mode
(Required)
Description
Specifies a mode for grayscale transformation.
Type
String
Candidate Mode List
GTM_ORIGINAL
GTM_INVERTED
GTM_AUTO

Default Setting

If the GrayscaleTransformationModes is not configured in your template file, the following settings will be used as the default settings.

For Barcode Decoding

{
    "GrayscaleTransformationModes": 
    [
        {
            "Mode": "GTM_ORIGINAL" 
        }
    ]
}

For Label Recognizing

{
    "GrayscaleTransformationModes": [
        {
            "Mode": "GTM_ORIGINAL"
        },
        {
            "Mode": "GTM_INVERTED" 
        }
    ]
}

For Document Scanning

{
    "GrayscaleTransformationModes": 
    [
        {
            "Mode": "GTM_ORIGINAL" 
        }
    ]
}

Candidate Modes Introduction

GTM_ORIGINAL

Keeps the original grayscale.

GTM_INVERTED

Transforms the image to inverted grayscale.

GTM_AUTO

Let the library choose automatically for grayscale transformation.

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest version (2.2.20)
    • Version 2.x
      • Version 2.2.10
      • Version 2.2.0
      • Version 2.0.30
      • Version 2.0.20
      • Version 2.0.10
      • Version 2.0.0
    Change +
    © 2003–2024 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support