Project

General

Profile

Actions

Feature #829

open

JPEG decoder should use JPEG component identifiers to guess the color model used

Added by Marco Eichelberg over 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Library and Apps
Target version:
-
Start date:
2018-05-03
Due date:
% Done:

0%

Estimated time:
Module:
dcmjpeg
Operating System:
Compiler:

Description

Most color JPEG images internally use the YCbCr color model. Unfortunately,
in rare cases also JPEG baseline compressed color images that use RGB
can be encountered, and DCMTK currently by default assumes that these are
YBR_FULL and performs a color space conversion upon decompression, leading
to an incorrect display.

According to information received from Dave Harvey, these rare RGB images
which were produced by some Adobe tools can be recognized by the
"ComponentIdentifier" numbers in the JPEG_SOF parameters. Normally these
identifiers, which are arbitrary bytes, have the values 0, 1 and 2.

In the case of Adobe RGB images, however, they always use the numbers
82, 71 and 66, which are the ASCII codes for "R", "G" and "B", as hints
that this is really RGB data.

Our JPEG decoder should specifically look for these component identifiers,
and if found, assume an RGB encoding.

Attached is an example of a JPEG image with RGB encoding, with and without DICOM "wrapper".


Files

rgb_example.jpg (2.47 MB) rgb_example.jpg Marco Eichelberg, 2018-05-03 09:22
rgb_example.dcm (2.47 MB) rgb_example.dcm Marco Eichelberg, 2018-05-03 09:22

Related issues 1 (0 open1 closed)

Related to DCMTK - Feature #830: img2dcm should use JPEG component identifiers to guess the color model usedClosed2018-05-03

Actions
Actions

Also available in: Atom PDF