Project

General

Profile

Actions

Feature #830

closed

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

Added by Marco Eichelberg over 7 years ago. Updated 8 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Application
Target version:
-
Start date:
2018-05-03
Due date:
% Done:

100%

Estimated time:
Module:
dcmdata
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.

When converting a color JPEG image to DICOM, img2dcm currently assumes
that this uses YCbCr color model, which causes an incorrect image to be
created when an RGB JPEG image is used.

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.

img2dcm should specifically look for these component identifiers,
and if found, assume an RGB encoding (i.e. set PhotometricInterpretation to "RGB").

Attached is an example of a JPEG image with RGB encoding.


Files

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

Related issues 1 (1 open0 closed)

Related to DCMTK - Feature #829: JPEG decoder should use JPEG component identifiers to guess the color model usedNew2018-05-03

Actions
Actions

Also available in: Atom PDF