Covert 16-bit pgm to 16-bit JPEG

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jackhab

Covert 16-bit pgm to 16-bit JPEG

Post by jackhab »

Is it possible to covert 16-bit pgm to 16-bit JPEG? I converted pgm to 16-bit tiff, but when I tried to converted to jpg ImageMagick creates 8-bit image.
I use 16-bit version 6.4.0.3.

Thanks.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Covert 16-bit pgm to 16-bit JPEG

Post by fmw42 »

If it does not do it automatically, then try adding -depth 16

convert image.pgm -depth 16 image.jpg

See if that works.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Covert 16-bit pgm to 16-bit JPEG

Post by magick »

JPEG supports 8 and 12 bit images. However, you have to enable 12-bit support when you build the JPEG delegate library before 12-bit JPEG images can be written with ImageMagick.
jackhab

Re: Covert 16-bit pgm to 16-bit JPEG

Post by jackhab »

magick wrote:JPEG supports 8 and 12 bit images. However, you have to enable 12-bit support when you build the JPEG delegate library before 12-bit JPEG images can be written with ImageMagick.
I've never compiled ImageMagick. Would you, please, give me some details on that?

I managed to get 24-bit jpeg with

Code: Select all

-depth 24 -type truecolor
but it seems to simply ignore when I request the depth of 12.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Covert 16-bit pgm to 16-bit JPEG

Post by magick »

ImageMagick cannot create 12-bit JPEG images until the JPEG delegate library is first compiled with 12-bit support (the default is 8-bit). To compile ImageMagick from source see http://www.imagemagick.org/script/install-source.php.
Post Reply