- 23 Oct 2024
- 2 Minutes to read
- DarkLight
- PDF
Generate CrontoSign and Cronto Dynamic images with the Image Generator SDK
- Updated on 23 Oct 2024
- 2 Minutes to read
- DarkLight
- PDF
The Image Generator SDK provides two APIs to generate Cronto images:
GenerateCrontoSign: This method is used to generate Cronto images with 25 x 25 squares. This type of Cronto image is limited to data with a size of max. 200 hexadecimal characters (i.e. 100 bytes).
Use the GenerateCrontoSign method to generate Cronto images compatible with OneSpan hardware authenticators (e.g. Digipass 760, Digipass 780).
This method also exists without the onPaper parameter; in that case this parameter is set to true.
GenerateDynamicCrontoImage: This method is used to generate Cronto images with a dynamic number of squares. This type of Cronto image is limited to data with a size of max. 1070 hexadecimal characters (i.e. 535 bytes).
The Cronto images generated with the GenerateDynamicCrontoImage method cannot be scanned by OneSpan hardware authenticators (e.g. Digipass 760, Digipass 780).
Number of squares in generated images lists the relation between the size of the data embedded in a generated image and the number of squares of the generated image.
Number of squares in generated images | |
Data in bytes | Number of squares |
---|---|
0–100 | 25 x 25 |
101–199 | 35 x 35 |
200–351 | 45 x 45 |
352–535 | 55 x 55 |
Parameters
GenerateCrontoSign / GenerateDynamicCrontoImage parameters lists the parameters of the GenerateCrontoSign and GenerateDynamicCrontoImagemethods.
GenerateCrontoSign / GenerateDynamicCrontoImage parameters | ||
Parameter name | Data type | Description |
---|---|---|
squareSize | int | The size in pixel of a Cronto image color square. The minimum square size is 1 pixel (ImageGeneratorSDKConstants.CRONTOSIGN_MIN_SQUARE_SIZE), the maximum square size is 80 pixels (ImageGeneratorSDKConstants.CRONTOSIGN_MAX_SQUARE_SIZE). |
inputValue | String | The hexadecimal string to be encoded. |
onPaper | bool | True if the image is generated to be printed on paper; in that case, the scanning process is optimized and the detection speed is improved. |
Return value
The returned value is a buffered Image object in the Java edition and a SkiaSharp bitmap object in the .NET edition.
For more information about this method, refer to the technical documentation delivered in the Image Generator SDK package.
Additional considerations
To achieve faster results when the end-user scans the image from paper, your images must be printed according to these guidelines:
Print on matte paper to avoid reflections on the image.
Print colored images in high contrast to ensure clear and distinct colors. Common color problems arise due to an insufficient difference between blue and green, or blue and black—ensure to have a clear contrast between those colors.
The closer the paper image colors are to the screen image colors, the better the scanning performance will be.
Depending on your printer, colors on printed images can differ completely from those displayed on your monitor. This is due to predefined color profiles in your printer configuration which create images with mismatching colors. If your printer allows it, change or disable this profile.
The paper used to print the image must not be creased.
If your printed images are too small, they may not be correctly detected for scanning. Optimal sizes of printed images to be scanned are:
7 x 7 cm for 55 points
6 x 6 cm for 45 points
5 x 5 cm for 35 points, and
4 x 4 cm for 25 points.
For a correct scan of an image, the end user must comply with these guidelines:
To scan the image, sufficient light is required.
During the scan, ensure that the camera is placed in front of the image.
Do not scan too far or too close from the image; the scanning screen must contain the whole content of the image. When scanning the image, ensure that the rendered image on the scanning screen is at least half the size of the shorter side of the screen.