0

I want to compress a binary image using JPEG-XR. For that, I downloaded jxrlib and built it. According to the instructions for encoding an image:

    JXREncApp [options]...

  -i input.bmp/tif/hdr         Input image file name
                               bmp: <=8bpc, BGR
                               tif: >=8bpc, RGB
                               hdr: 24bppRGBE only

  -o output.jxr                Output JPEG XR file name

  -q quality                   [0.0 - 1.0) Default = 1.0, lossless
  or quantization              [1   - 255] Default = 1, lossless

  -c format                    Required to define uncompressed source pixel format
                                0: 24bppBGR
                                1: 1bppBlackWhite
                                2: 8bppGray
                                3: 16bppGray
                                4: 16bppGrayFixedPoint
                                5: 16bppGrayHalf
                                7: 32bppGrayFixedPoint
                                8: 32bppGrayFloat
                                9: 24bppRGB
                               10: 48bppRGB
                               11: 48bppRGBFixedPoint
                               12: 48bppRGBHalf
                               14: 96bppRGBFixedPoint
                               15: 128bppRGBFloat
                               16: 32bppRGBE
                               17: 32bppCMYK
                               18: 64bppCMYK
                               22: 32bppBGRA
                               23: 64bppRGBA
                               24: 64bppRGBAFixedPoint
                               25: 64bppRGBAHalf
                               27: 128bppRGBAFixedPoint
                               28: 128bppRGBAFloat
                               29: 16bppBGR555
                               30: 16bppBGR565
                               31: 32bppBGR101010
                               32: 40bppCMYKA
                               33: 80bppCMYKA
                               34: 32bppBGR

  -d chroma sub-sampling       0: Y-only
                               1: YCoCg 4:2:0
                               2: YCoCg 4:2:2
                               3: YCoCg 4:4:4 (default)
     (if not set is 4:4:4 for quality >= 0.5 or 4:2:0 for quality < 0.5)

  -l overlapping               0: No overlapping
                               1: One level overlapping (default)
                               2: Two level overlapping
     (if not set is One for quality > 0.4 or Two for quality <= 0.4)

  -f                           Turn off frequency order bit stream (to spatial)

  -p                           Turn off progressive mode (to sequential)

  -t                           Display timing information

  -v                           Display verbose encoder information

  -V tile_wd0 [tile_wd1 ... ]  Macro block columns per tile 

  -H tile_ht0 [tile_ht1 ... ]  Macro block rows per tile

  -U num_v_tiles num_h_tiles   Vertical & horizontal tile count for uniform tiling

  -b Black/White               Applies to 1bpp black/white images
                               0: 0 = black (default)
                               1: 0 = white

  -a alpha channel format      Required for any pixel format with an alpha channel
                               2: Planar alpha (default)
                               3: Interleaved alpha
                               Other: Reserved, do not use

  -Q quantization for alpha    [1 - 255] Default = 1, lossless

  -F trimmed flexbits          [0 - 15]  0: no trimming (default)
                                        15: trim all

  -s skip subbands             0: All subbands included (default)
                               1: Skip flexbits
                               2: Skip highpass
                               3: Skip highpass & lowpass (DC only)

Thus I am using the following command (for lossless compression):

JXREncApp -i Image3_3.bmp -o output.jxr -c 1

However the error is saying that:

FAILED: -106=WMP_errUnsupportedFormat
        C:\Users\DRS\Desktop\jxlib_2\jxrlib-master\JXRTestlib\JXRTestBmp.c:319
FAILED: -106=ParseBMPHeader(pID, pWS)
        C:\Users\DRS\Desktop\jxlib_2\jxrlib-master\JXRTestlib\JXRTestBmp.c:342
FAILED: -106=pDecoder->Initialize(pDecoder, pStream)
        C:\Users\DRS\Desktop\jxlib_2\jxrlib-master\JXRTestlib\JXRTest.c:221
FAILED: -106=pTestFactory->CreateDecoderFromFile(args.szInputFile, &pDecoder)
        C:\Users\Dr. Suhash\Desktop\jxlib_2\jxrlib-master\jxrencoderdecoder\JxrEncApp.c:636

I am not able to understand what the error could be and how to resolve it. If you know, then please help.

1 Answers1

0

The error messages seem to imply your BMP is of an unsupported type or bit-depth.

I would suggest you either share your BMP (using Dropbox or Google Drive), or analyse it with exiftool, e.g.:

exiftool YOURIMAGE.BMP
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
  • Yes, the bit depth is the problem. In the command line instructions it is said that jxrlib supports compression for 1bpp image but it is not true. it does not have support for 1bpp image. The image that I was uploading was of the order 1bpp – Sahil Sharma May 09 '23 at 19:19