From 0849d5583a8afb2e240b9fdd2cbb76bf14d6c033 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Wed, 2 Mar 2022 11:00:10 +0100 Subject: [PATCH] Document behavior of -c flag for JPEG-LS Upon compression an application data marker segment (14) is added to the JPEG-LS stream. Upon decompression, even when a SPIFF header is present (with RGB) space, one must instruct the decompression step to use RGB space (disable color transformation). --- README | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README b/README index 156d430..a44a394 100644 --- a/README +++ b/README @@ -142,7 +142,9 @@ that, use the command line option -ls: $ jpeg -ls -c infile.ppm out.jpg The "-c" command line switch is necessary to disable the color transformation -as JPEG LS typically encodes in RGB and not YCbCr space. +as JPEG LS typically encodes in RGB and not YCbCr space. This will introduce an +application data marker Adobe 14 to indicate the RGB color space in the output +stream. Optionally, you may specify the JPEG LS "near" parameter (maximum error) with the -m command line switch: @@ -193,10 +195,10 @@ or, for floating point images: $ jpeg infile.jpg out.pfm -If you want to decode a JPEG LS image, then you may want to tell the -decoder explicitly to disable the color transformation even though the -corresponding marker signalling coding in RGB space is typically missing -for JPEG LS: +If you want to decode a JPEG LS image, even one containing a SPIFF header with +rgb colorspace, then you may want to tell the decoder explicitly to disable the +color transformation even though the corresponding marker signalling coding in +RGB space is typically missing for JPEG LS: $ jpeg -c infile.jpg out.ppm