"WSQ image library" for Android (version 3.0 , last updated: 2022-03-23)
FBI certified WSQ implementation number:
11288 (scanned certificate)





  

WSQ image library adds the power of WSQ (FBI's Wavelet Scalar Quantization) file format to your software projects using only a few lines of code.
The library also supports JPEG-2000, ANSI/NIST-ITL 1-2000 Type-8 signature and other graphic file formats and allows conversion between them.

Free WSQ Viewer demonstrates capabilities of WSQ image library.


Importance of WSQ format


Electronic fingerprints submitted to the FBI either through Integrated Automated Fingerprint Identification System (IAFIS), or Electronic Fingerprint Image Print System (EFIPS) may not be compressed with any technique other than WSQ.

Licensing of WSQ image library


How long does the license last?
Buy once, use forever!
The license is perpetual. There is no annual fee. There is no timing limitation.
“WSQ image library” is NOT a subscription.
All future updates are included with your one-time purchase at no additional charge.
You will get all updated versions of “WSQ image library” without any additional payment.


Price of WSQ image library


WSQ image library (for Android) runtime free / royalty free license costs 758.00 U.S. dollars.

Runtime free/royalty free licennse means when you buy such a license, your organization/company can run “WSQ image library (for Android)” on unlimited number of devices.

Android, Windows 32-bit, Windows 64-bit, Linux 32-bit, Linux 64-bit and macOS 64-bit versions of WSQ Image Library are considered separate products and each has its own pricing.
To order "WSQ image library (for Android)" please click here


Screenshots of WSQ image library sample project




Table 1 “WSQ image library” sample projects


Program Size
WSQ image library Android Studio Bumblebee | 2021.1.1 Patch 2 (minSdkVersion API 19 Android 4.4 (KitKat), targetSdkVersion API 31 Android 12 (Snow Cone), Android NDK 21.4.7075529) Java sample project 1121 KB Download
WSQ image library Shared Library (*.so) Android. Version 3.0 1001 KB Download
WSQ image library Android (API level 19 Android 4.4 (KitKat)) sample project application package file (APK)
QR-Code of download link
qr_code_Android_Studio_2021_WSQ_java_demo_apk
4964 KB Download
WSQ image library Android (API level 19 Android 4.4 (KitKat)) sample project application package file (AAB)
QR-Code of download link
qr_code_Android_Studio_2021_WSQ_java_demo_aab
4120 KB Download
WSQ (FBI's Wavelet Scalar Quantization) sample image file
QR-Code of download link
qr_code_WSQ_sample_image
23 KB Download
ZIPed WSQ sample image file
QR-Code of download link
qr_code_sample_WSQ_images_zip
23 KB Download
ZIPed NIST (ANSI/NIST-ITL 1-2000) Type-8 signature image sample files
QR-Code of download link
qr_code_nist_type8_signature_samples_zip
59 KB Download





WSQ image library (for Android) specifications



Table 2 Format of WSQ image library

FeatureFormat
Operating systemAndroid (arm64-v8a/armeabi-v7a/x86/x86_64)
Library formatShared Library (*.so)
Format of exported functionsC language
Calling convention
of exported functions
(default)
JNIEXPORT
Internal engineC++



Table 3 Supported formats for reading

FormatDescription
"WSQ image library" supported image formats:
WSQFBI's Wavelet Scalar Quantization
JP2JPEG-2000 Part-1
JPCJPEG-2000 Code Stream
PBMPortable Bitmap Format
PGMPortable Graymap Format
PPMPortable Pixmap Format
BINANSI/NIST-ITL 1-2000 Type-8 signature (Uncompressed scanned binary image data)
BINANSI/NIST-ITL 1-2000 Type-8 signature (ANSI/EIA-538-1988 facsimile compression)
Android natively supported image formats:
BMPWindows Bitmap Graphics
GIFCompuserve Graphic Interchange Format
JPGJoint Photographic Experts Group
PNGPortable Network Graphics
WEBPWeb Picture
HEIFHigh Efficiency Image File



Table 4 Supported formats for writing

FormatDescription
"WSQ image library" supported image formats:
WSQFBI's Wavelet Scalar Quantization
JP2JPEG-2000 Part-1
JPCJPEG-2000 Code Stream
PBMPortable Bitmap Format
PGMPortable Graymap Format
PPMPortable Pixmap Format
BINANSI/NIST-ITL 1-2000 Type-8 signature (Uncompressed scanned binary image data)
BINANSI/NIST-ITL 1-2000 Type-8 signature (ANSI/EIA-538-1988 facsimile compression)
Android natively supported image formats:
JPGJoint Photographic Experts Group
PNGPortable Network Graphics
WEBPWeb Picture



Table 5 Functions available in the library

FunctionDescription
public static native byte [] WSQ_decode_stream(byte [] input, int [] imageProperties)Decodes memory stream (memory block) from WSQ format into uncompressed format. Returns 1 if successful, or error code otherwise.
public static native byte [] WSQ_encode_stream(byte [] input, int width, int height, double bitrate, int ppi, String comment_text)Encodes memory stream (memory block) from uncompressed format into WSQ format. Returns 1 if successful, or error code otherwise.
public static native void WriteWSQ_bitrate(double bitrate)Sets current WSQ bitrate. For example 0.75, 2.25 (-1.0 if unknown)
public static native double ReadWSQ_bitrate()Reads current WSQ bitrate. For example 0.75, 2.25 (-1.0 if unknown)
public static native void WriteWSQ_ppi(int ppi)Sets current WSQ ppi (pixels per inch). Value "-1" is used for unknown ppi.
public static native int ReadWSQ_ppi()Reads current WSQ ppi (pixels per inch). Value "-1" is used for unknown ppi.
public static native int ReadWSQ_implementation_number()Reads current WSQ implementation number
public static native void WriteWSQ_comment(String comment)Sets current WSQ comment text.
public native String ReadWSQ_comment()Reads current WSQ comment text.
public static native byte [] JP2_decode_stream(byte [] input, int [] imageProperties)Decodes memory stream (memory block) from JP2 format into uncompressed format. Returns 1 if successful, or error code otherwise.
public static native byte [] JP2_encode_stream(byte [] input, int width, int height)Encodes memory stream (memory block) from uncompressed format into JP2 format. Returns 1 if successful, or error code otherwise.
public static native byte [] JPC_decode_stream(byte [] input, int [] imageProperties)Decodes memory stream (memory block) from JPC format into uncompressed format. Returns 1 if successful, or error code otherwise.
public static native byte [] JPC_encode_stream(byte [] input, int width, int height)Encodes memory stream (memory block) from uncompressed format into JPC format. Returns 1 if successful, or error code otherwise.
public static native byte [] PBM_decode_stream(byte [] input, int [] imageProperties)Decodes memory stream (memory block) from PBM format into uncompressed format. Returns 1 if successful, or error code otherwise.
public static native byte [] PBM_encode_stream(byte [] input, int width, int height)Encodes memory stream (memory block) from uncompressed format into PBM format. Returns 1 if successful, or error code otherwise.
public static native byte [] PGM_decode_stream(byte [] input, int [] imageProperties)Decodes memory stream (memory block) from PGM format into uncompressed format. Returns 1 if successful, or error code otherwise.
public static native byte [] PGM_encode_stream(byte [] input, int width, int height)Encodes memory stream (memory block) from uncompressed format into PGM format. Returns 1 if successful, or error code otherwise.
public static native byte [] PPM_decode_stream(byte [] input, int [] imageProperties)Decodes memory stream (memory block) from PPM format into uncompressed format. Returns 1 if successful, or error code otherwise.
public static native byte [] PPM_encode_stream(byte [] input, int width, int height)Encodes memory stream (memory block) from uncompressed format into PPM format. Returns 1 if successful, or error code otherwise.
public static native byte [] CreateImageFromNISTType8UncompressedBinaryField(byte [] input, int width, int height)Decodes memory stream (memory block) from ANSI/NIST-ITL 1-2000 Type-8 signature (Uncompressed scanned binary image data) format into uncompressed format. Returns 1 if successful, or error code otherwise.
public static native byte [] CreateImageFromNISTType8CompressedBinaryField(byte [] input, int width, int height)Decodes memory stream (memory block) from ANSI/NIST-ITL 1-2000 Type-8 signature (ANSI/EIA-538-1988 facsimile compression) format into uncompressed format. Returns 1 if successful, or error code otherwise.
public static native byte [] CreateNISTType8UncompressedBinaryFieldfromImage(byte [] input, int width, int height)Encodes memory stream (memory block) from uncompressed format into ANSI/NIST-ITL 1-2000 Type-8 signature (Uncompressed scanned binary image data) format. Returns 1 if successful, or error code otherwise.
public static native byte [] CreateNISTType8CompressedBinaryFieldfromImage(byte [] input, int width, int height)Encodes memory stream (memory block) from uncompressed format into ANSI/NIST-ITL 1-2000 Type-8 signature (ANSI/EIA-538-1988 facsimile compression) format. Returns 1 if successful, or error code otherwise.
public static native String GenerateWSQLibrarySerialNumber()Generates serial number for registration of WSQ image library.
public static native int UnlockWSQLibrary(String authorization_code)Registers WSQ image library on the device. Returns 1 if successful, 0 otherwise.
Below are obsolete functions which do not work on Android 10 and later: Android 10 introduced new storage paradigm for apps called scoped storage. Scoped storage changes the way apps store and access files on a device's external storage.
In Android 10 apps can no longer read files using filename, now you have to use Uri for file reading.
public static native int [] ReadImageFromFile(int [] dimension, String fileName)Creates an image data array from an image file. The extension of the file name determines the file type. Returns an 1 if successful, 0 otherwise.
public static native void SaveImageToFile(int [] data, int width, int height, String fileName, int type)Saves the contents of an image data array to a file. Returns 1 if successful, 0 otherwise.
"filetype" denotes integer with possible values:
1 - WSQ
2 - Windows BMP
3 - TIFF
4 - PNG
5 - JPEG
6 - Targa
7 - RGB
public static native void WriteTIFFcompression(int tiff_compression)Sets the TIFF compression type. Available options are:
0 - NONE
1 - ZIP compression
(if ZIP compression is used, you also need to set TIFF "predictor" parameter)
2 - MACINTOSH compression
public static native void WriteTIFFpredictor(int tiff_predictor)Sets the TIFF ZIP compression predictor value.
public static native void Set_Path_of_WSQ_library(String path_of_WSQ_library)Sets path of "WSQ image library".



WSQ format description


In the USA, fingerprints have traditionally been collected on cards, each card containing the inked impressions of all ten fingers. The U.S. Federal Bureau of Investigation's fingerprint database began in 1924 with a cataloged collection of 810,188 cards. By the start of World War II, this collection had grown to over 10 million cards, and by 1946 had reached over 100 million cards.

In 1995 this collection was contained on over 200 million cards stored in filing cabinets occupying one acre of floor space in the J. Edgar Hoover building in Washington D.C. and archive size was increasing at the rate of 30,000 to 50,000 new cards per day.

Digitization of fingerprint cards seemed to be the most obvious choice and the project named FBI's Integrated Automated Fingerprint Identification System (IAFIS) was started to cope with the design and implementation of a national standard for collecting, encoding, storing, and retrieving digitized fingerprint images. According to the FBI standard fingerprints are stored as 8-bit grayscale images. Each fingerprint card, when digitized at 500 dpi requires about 10 Mbytes of storage. The FBI's entire collection would therefore consume two petabytes (2,000,000,000 megabytes) of electronic storage space.

The need for an effective compression technique was then very urgent. Unfortunately, neither the well-known lossless methods nor the JPEG methods were found to be satisfactory. Most lossy compression methods, such as JPEG, discard the smallest (highest frequency) details in images, and at higher compression ratios unacceptably distorts the image. Contained within fingerprints are tiny details that are considered admissible points of identification in a court of law. To JPEG, these details may be regarded as noise and removed. The JPEG quantization matrix also allows blocking artifacts to occur in the image at compression ratios above about 10:1. Shifting bits to the high frequencies to preserve small details will only make the blocking worse.

Lossless compression methods, such as LZW and JBIG, cannot achieve the high compression ratios of WSQ on fingerprint data, with 2:1 typically being the best.

A new compression technique (with small acceptable loss), called Wavelet Scalar Quantization (WSQ) was developed and it became the FBI standard for the compression of 500 dpi fingerprint images.

WSQ is a lossy compression method that is well-suited for preserving the very high resolution details of grayscale images while maintaining high compression ratios of typically 12:1 to 15:1 on images that have not undergone "quality enhancements" (such as histogram equalization) to improve the appearance of the image.



Table 6 WSQ file format specifications

FeatureDescription
NameFBI's Wavelet Scalar Quantization file format.
Also known as: FBI Fingerprint Format or FBI WSQ
ApplicationThe standard file format used by the FBI for storage and interchange of grayscale fingerprint images
OriginatorFBI (U.S. Federal Bureau of Investigation)
TypeBitmap
Colors8 bit grayscale
CompressionWavelet Scalar Quantization
Maximum image size64K x 64K
Multiple images per fileNo



Adding WSQ image library to your software project


Using "WSQ image library" is very easy. Only 4 steps and a few lines of code are needed. Several examples are provided below.
Java


Java


Step 1
Put the file "WSQlib.java" into your project's directory
"app/src/main/java/com/cognaxon"


Step 2
Add the following line at the beginning of your java program code:
import com.cognaxon.WSQlib;


Step 3
Copy the contents of directory "jniLibs" (full path is "/app/src/main/jniLibs/")
into your project's directory
"/app/src/main/"


Step 4
Create new instance of "WSQ image library":
WSQlibrary = new WSQlib();


Step 5
Call and use "WSQ image library" functions in your Java program code using "WSQlib" as shown in sample project.


JNI function prototypes are listed in the file
"WSQlib.java"



To download Android Studio 2021 Java sample project click here
To download Android application package file (APK) click here



Copyright ©2024 Cognaxon. All rights reserved. Privacy