Hi,
I'm trying to convert a 4-bit-Bitmap into an 8-bit-Bitmap. When I use the command
convert testimage.bmp -colors 256 -depth 8 -type Palette testimage2.bmp
the result is still a 4-Bit-Bitmap. Calling identify for both images returns
testimage.bmp BMP 1302x272 1302x272+0+0 4-bit sRGB 16c 178KB 0.000u 0:00.000
and
testimage2.bmp BMP 1302x272 1302x272+0+0 4-bit sRGB 16c 178KB 0.000u 0:00.000
What am I doing wrong?
This is the image I'm using: https://www.dropbox.com/s/xbhqdzcm9ikoc ... e.bmp?dl=0
I'm using ImageMagick 6.9.7-4 in a Shell on Ubuntu 18.04.
Thank you in advance for your help!
Bitmap has 4-bit-palette instead of 8-bit
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Bitmap has 4-bit-palette instead of 8-bit
Don't use "identify" to find the structure of an image file, because identify will tell you the structure of the image after it has been decoded. Instead, use exiftool:
I don't think there is a reliable method for telling IM to use a palette that is larger than it needs to be. The image has only 8 different colours, so IM uses a palette with 16 entries.
"-colors N" is a colour reduction method. If your image already has N or fewer colours, it has no effect.
Code: Select all
f:\web\im>exiftool testimage.bmp
ExifTool Version Number : 10.97
File Name : testimage.bmp
:
:
Bit Depth : 4
Num Colors : 16
Num Important Colors : 16
"-colors N" is a colour reduction method. If your image already has N or fewer colours, it has no effect.
snibgo's IM pages: im.snibgo.com
Re: Bitmap has 4-bit-palette instead of 8-bit
Thank you very much for your answer and your comments! I will look for another tool to (always) get an 8-bit-Bitmap then.