[magick-users] Converting 16-bit GRAY files to 8 bits

Anthony Thyssen A.Thyssen at griffith.edu.au
Sun Feb 1 22:58:02 PST 2009


On Sun, 01 Feb 2009 08:58:36 -0500 (Eastern Standard Time)
magick-users-bounces at imagemagick.org wrote:

| I am trying to convert 16-bit GRAY files to 8-bit JPEG or PNG format.
| Since the original images are actually 12-bit, I assume that I need to 
| right-shift each pixel, so I'm using a command like
| 
| convert -size 512x512+3416 -depth 16 -evaluate RightShift 4 -endian LSB gray:c_vf1169.fre c_vf1169_rs4_lsb.png
| 
| The effect seems to be that the high-order byte is simply ignored when 
| the right-shift is done. Could someone please explain what I'm doing 
| wrong? I'm using IM 6.2.4 Q16 as distributed by Debian.
| 
| I apologize if this is really obvious, but I haven't been able to 
| figure it out or find an answer.
| 
perhaps the 12 bit values in 16 bit integers are already right shifted?


  Anthony Thyssen ( System Programmer )    <A.Thyssen at griffith.edu.au>
 -----------------------------------------------------------------------------
    The three most dangerous things in the world are a programmer
    with a soldering iron, a hardware type with a program patch and
    a user with an idea.                 -- anchient computer saying
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/


More information about the Magick-users mailing list