Save an image in a BMP uncompressed format.
Save an image in a BMP uncompressed format.
I don't know if anyone know how I can save an image into BMP file in Imagemagick but being uncompressed, having 24bits per pixel (no alpha channel). ImageMagick saves an image into BMP by default in compressed and 32bits per pixels (alpha channel). Thanks!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Save an image in a BMP uncompressed format.
see http://www.imagemagick.org/Usage/formats/#bmp
I don't know about the compression, but
convert image +matte image.bmp
should save as 24-bit without alpha
You might also try
convert image +matte +compress image.bmp
to see if that will turn off the compression, if it is still there.
I don't know about the compression, but
convert image +matte image.bmp
should save as 24-bit without alpha
You might also try
convert image +matte +compress image.bmp
to see if that will turn off the compression, if it is still there.
Re: Save an image in a BMP uncompressed format.
Could you be more specific with the convert +matte command ? I mean the full syntax of these commands. I am using ImageMagick C++. Thanks for the fast response!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Save an image in a BMP uncompressed format.
Sorry, I know nothing about using IM in any API situation. I have only had experience with the command line IM.
All I can tell you is that +matte (or -alpha off) turns off the alpha channel. Similarly +compress turns off compression, but may be particular only to certain image types, such as jpg. I know little about +compress and which image types with which it can be used.
see http://www.imagemagick.org/script/comma ... p#compress
All I can tell you is that +matte (or -alpha off) turns off the alpha channel. Similarly +compress turns off compression, but may be particular only to certain image types, such as jpg. I know little about +compress and which image types with which it can be used.
see http://www.imagemagick.org/script/comma ... p#compress
Re: Save an image in a BMP uncompressed format.
Hi folks,
I know this is an old thread, but I am facing similar problems that lead me here.
I have an uncompressed .bmp file (containing a rectangular image) that I have crop using:
convert <file> -crop <dimension-x + y> <new-filename>
.BMP File is still uncompressed at this stage.
After the crop, I rotated using the following:
mogrify -alpha OFF -rotate 90 <new-filename>
The suddenly, this causes the new-filename to contain compressed BMP (as shown with a xxd check of the BMP file header).
Originally, I had not use the -alpha option (the +matte has been deprecated in v6.6.0-4 2010). Adding the -alpha OFF option did not solve that (having the same compressed final image).
I need my image to be uncompressed.
Any advice is appreciated. Thanks in advance.
Best regards
I know this is an old thread, but I am facing similar problems that lead me here.
I have an uncompressed .bmp file (containing a rectangular image) that I have crop using:
convert <file> -crop <dimension-x + y> <new-filename>
.BMP File is still uncompressed at this stage.
After the crop, I rotated using the following:
mogrify -alpha OFF -rotate 90 <new-filename>
The suddenly, this causes the new-filename to contain compressed BMP (as shown with a xxd check of the BMP file header).
Originally, I had not use the -alpha option (the +matte has been deprecated in v6.6.0-4 2010). Adding the -alpha OFF option did not solve that (having the same compressed final image).
I need my image to be uncompressed.
Any advice is appreciated. Thanks in advance.
Best regards
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Save an image in a BMP uncompressed format.
try saving to the older BMP formats by adding BMP3:image.bmp or BMP2:image.bmp see if that helps see http://www.imagemagick.org/Usage/formats/#bmp
Also if just processing one file, I would recommend using convert rather than mogrify.
convert inputimage -alpha off -rotate 90 outputimage
but the -alpha off could be left off, since it has nothing to do with compression.
Try adding -compress none and see if that helps
http://www.imagemagick.org/script/comma ... p#compress
Also if just processing one file, I would recommend using convert rather than mogrify.
Code: Select all
mogrify -alpha OFF -rotate 90 <new-filename>
but the -alpha off could be left off, since it has nothing to do with compression.
Try adding -compress none and see if that helps
http://www.imagemagick.org/script/comma ... p#compress
Re: Save an image in a BMP uncompressed format.
Actually alpha does have something to do with compression. If image->mattefmw42 wrote: but the -alpha off could be left off, since it has nothing to do with compression.
is true (meaning alpha is present), the BMP encoder uses the BMP4 format.
See this comment in coders/bmp.c:
- % WriteBMPImage() writes an image in Microsoft Windows bitmap encoded
% image format, version 3 for Windows or (if the image has a matte channel)
% version 4.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Save an image in a BMP uncompressed format.
I stand corrected. Thanks Glenn.