Indexed BMP conversion

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
Hietala

Indexed BMP conversion

Post by Hietala »

Hello, I'm trying to convert some 24 bit BMPs into 8 bit with a palette that contains only the used colors, but that always results in a bitmap with the 256 palette entries even when the image use 4 or 5 colors, so my question is if it is possible to have any unused entries removed, I have tried this basically

Code: Select all

convert inimage.bmp -compress None -colors 256 BMP3:outimage.bmp
I also tried -type Palette and -depth 8

Version: ImageMagick 6.9.0-0 Q16 x86 2014-11-14
Platform: Windows 7
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Indexed BMP conversion

Post by fmw42 »

see -remap with +dither (or -dither none) at http://www.imagemagick.org/Usage/quantize/#remap. Prepare ahead of time the colors your want to keep and make them into an image (one pixel per color)
Post Reply