### ImageMagick version

7.1.1-3

### Operating system

MacOS

### Operating system, version and so on

MacOS 13.0, aarch64. ImageMagick from brew for x86_64 running through Rosetta

### Description

For some rare bizarre old systems and programs, BMP images with palette must have precise image depth (4bpp or 8bpp). I was hoping to convert images  to this format with ImageMagick. Unfortunately, it looks like if the source image has palette that is smaller than depth specified as a target, the ImageMagick will generate BMP file with smaller image depth than requested. This might be nice for creating smaller BMP files, but doesn't help when it comes to retrocomputing or specific applications.

### Steps to Reproduce

File white.png is a pure white image. File palette.png has 16 colors.
The target is bmp3 with depth=8 and colors=256.
Expectations: PC bitmap 8bpp
Reality: PC bitmap 1bpp and 4bpp
```
$ convert white.png -define bmp:format=bmp3 -depth 8 -colors 256 BMP3:white.bmp
$ convert palette.png -define bmp:format=bmp3 -depth 8 -colors 256 BMP3:palette.bmp
$ file white.bmp
white.bmp: PC bitmap, Windows 3.x format, 160 x 100 x 1, image size 2000, resolution 196 x 236 px/m, 2 important colors, cbSize 2062, bits offset 62
$ file palette.bmp
palette.bmp: PC bitmap, Windows 3.x format, 4 x 4 x 4, image size 16, resolution 11811 x 11811 px/m, 16 important colors, cbSize 806, bits offset 118
```

### Images

![white](https://github.com/ImageMagick/ImageMagick/assets/15848389/4d9dad95-92cb-40ee-92ef-c9275b4bfcbb)
![palette](https://github.com/ImageMagick/ImageMagick/assets/15848389/0e11d703-b796-445c-a2a2-76038e868ba6)

BMP3 exporter ignores desired image depth when lower image depth is possible
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : BMP3 exporter ignores desired image depth when lower image depth is possible
Issue date:

--- start body ---
### ImageMagick version

7.1.1-3

### Operating system

MacOS

### Operating system, version and so on

MacOS 13.0, aarch64. ImageMagick from brew for x86_64 running through Rosetta

### Description

For some rare bizarre old systems and programs, BMP images with palette must have precise image depth (4bpp or 8bpp). I was hoping to convert images  to this format with ImageMagick. Unfortunately, it looks like if the source image has palette that is smaller than depth specified as a target, the ImageMagick will generate BMP file with smaller image depth than requested. This might be nice for creating smaller BMP files, but doesn't help when it comes to retrocomputing or specific applications.

### Steps to Reproduce

File white.png is a pure white image. File palette.png has 16 colors.
The target is bmp3 with depth=8 and colors=256.
Expectations: PC bitmap 8bpp
Reality: PC bitmap 1bpp and 4bpp
```
$ convert white.png -define bmp:format=bmp3 -depth 8 -colors 256 BMP3:white.bmp
$ convert palette.png -define bmp:format=bmp3 -depth 8 -colors 256 BMP3:palette.bmp
$ file white.bmp
white.bmp: PC bitmap, Windows 3.x format, 160 x 100 x 1, image size 2000, resolution 196 x 236 px/m, 2 important colors, cbSize 2062, bits offset 62
$ file palette.bmp
palette.bmp: PC bitmap, Windows 3.x format, 4 x 4 x 4, image size 16, resolution 11811 x 11811 px/m, 16 important colors, cbSize 806, bits offset 118
```

### Images

![white](https://github.com/ImageMagick/ImageMagick/assets/15848389/4d9dad95-92cb-40ee-92ef-c9275b4bfcbb)
![palette](https://github.com/ImageMagick/ImageMagick/assets/15848389/0e11d703-b796-445c-a2a2-76038e868ba6)

--- end body ---

None