Create quality jpeg image

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Anees Hassan
Posts: 10
Joined: Tue, 2019-07-16, 12:17

Create quality jpeg image

#1 Post by Anees Hassan »

I converted Dicom to JPEG using dcmj2pnm (dcmj2pnm --write-jpeg input.dcm output.jpeg), but image quality were very loosed,how can convert Dicom to JPEG without losing image quality

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Create quality jpeg image

#2 Post by Michael Onken »

Hi,

what do you mean by quality loss?

Note that some DICOM images have more grayscale values than JPEG can actually store i.e. there is inherent loss when converting to JPEG in such cases.

In many cases, however, dcmj2pnm can help selecting those grayscales that are most interesting and/or meaningful for a human viewer. For that look at the options regarding windowing. Try for example option +Wm or +Wi 1 with dcmj2pnm.

Best regards,
Michael

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Create quality jpeg image

#3 Post by J. Riesmeier »

JPEG Baseline, the output format of dcmj2pnm --write-jpeg, is always lossy. In case you want to store the rendered image with best quality, you should use another output format.

Of course, the answer also depends on what you mean by "without losing image quality"...

Anees Hassan
Posts: 10
Joined: Tue, 2019-07-16, 12:17

Re: Create quality jpeg image

#4 Post by Anees Hassan »

Thank you, I have used "+Wi 1 with dcmj2pnm" option to convert dicom to jpg file and the result was what i expected .
The comment as follows dcmj2pnm --write-jpeg +Wi 1 input.dcm output.jpeg.


Thanks again for your great suggestion

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 1 guest