Colors problems with 24bits lossy JPEG

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
m.bouthors
Posts: 5
Joined: Thu, 2006-06-15, 10:07

Colors problems with 24bits lossy JPEG

#1 Post by m.bouthors »

Hi,

I made some tests of my software (based on the dcmtk 3.5.4) I used the Leadtools dicom samples ( http://support.dcmtk.org/docs/classDico ... 0073eb3527 ), all works fine exepting the last file. This file a lossy 24bits JPEG. There is a problem with the colors of the rendered image.

I have tried with dcmj2pnm and there was the same problem. Obviously ImageMagick renders the file without any problems.

The file is directly downloadable here : http://www.leadtools.com/SDK/Medical/DI ... mage12.zip

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1445
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

This is not a problem of DCMTK but a problem of the sample image, which is defective. The image claims to have RGB photometric interpretation (which would be unusual for a lossy compressed image but entirely legal), but in fact contains YCbCr pixel data. With the dcm2pnm command line tool, you can use the command line option --conv-lossy to enable a workaround for this problem. Within the dcmjpeg API, in the first parameter to DJDecoderRegistration::registerCodecs() you should pass EDC_lossyOnly to enable the same workaround.

m.bouthors
Posts: 5
Joined: Thu, 2006-06-15, 10:07

#3 Post by m.bouthors »

Thanks for this answer and for the workaround.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest