[magick-users] How to create 4-bit grayscale bmp images?

Anthony Thyssen anthony at griffith.edu.au
Mon Jun 18 22:36:20 PDT 2007


"John Harragin" on  wrote...
| x=209;y=109; jpegtopnm /var/www/html/photos/cyclamin.jpg | ppmtopgm | pnmscale -xsize=${x} -ysize=${y} | ppmquant 16 | ppmtobmp -bpp=4 > /var/www/html/photos/background.bmp
| 
| Thanks Anthony. This command gets the job done. identify still reports 8 bits depth but the file is indeed about half that of one with 256 colors - even if I leave the -bpp=4 option out.
| 
| John
| 
You can simpliefy that with IM...

  convert /var/www/html/photos/cyclamin.jpg -resize 209x109 -colors 16 ppm:- |
    ppmtobmp -bpp=4 >  /var/www/html/photos/background.bmp

that is let IM do the work, then use NetPBM to get you that 4bit BMP


  Anthony Thyssen ( System Programmer )    <A.Thyssen at griffith.edu.au>
 -----------------------------------------------------------------------------
   Before you find your handsome prince, you've got to kiss a lot of frogs.
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/


More information about the Magick-users mailing list