Page 1 of 1

Convert image to 8-bit BMP with a predefined palette

Posted: 2011-11-08T22:22:31-07:00
by rling
Hi all!

I need to convert images to 8-bit BMPs with one byte per pixel and a palette.
The palettes in the output BMPs must have exactly 256 entries (even if some are unused).
The entries must be the grayscale levels 0..255 in increasing order. That is, index 0 is RGB triple (0,0,0) etc.

So far I've tried (in various combinations): -type Grayscale, -type Palette, -depth 8, -colors 256.
I can get a paletted bitmap easily, but I can't force it to use the exact palette I described: the
number of colours in the palette is always reduced to only those that are used by pixels.

I notice there is a -remap option which is not in my version (6.3.6).
Will -remap do what I need, given a BMP with the correct palette as its parameter?
If so I would have to upgrade.... but upgrading has implications, so if -remap won't help, I prefer not to.

Thanks!!
R