debugging 使用jxrlib压缩二进制图像

5fjcxozz  于 2023-05-18  发布在  其他
关注(0)|答案(1)|浏览(158)

我想使用JPEG-XR压缩二进制图像。为此,我下载了jxrlib并构建了它。根据用于对图像进行编码的指令:

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)

因此,我使用以下命令(用于无损压缩):

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

然而,错误是说:

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

我无法理解错误可能是什么以及如何解决它。如果你知道,请帮助。

wecizke3

wecizke31#

错误消息似乎暗示您的BMP是不受支持的类型或位深度。
我建议你要么分享你的BMP(使用Dropbox或Google Drive),要么用exiftool分析它,例如:

exiftool YOURIMAGE.BMP

相关问题