.BMP file much larger than expected

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
acal
Posts: 1
Joined: 2011-01-20T07:38:48-07:00
Authentication code: 8675308

.BMP file much larger than expected

Post by acal »

Hello,
I keep most of my personal documents on disk, and very frequently do scans,
followed by deskewing, on .bmp files with 256 levels-of-grey.

But my deskewed files are much bigger than the originals!
"identify" on the original and deskewed images reports:

Original/test.bmp BMP 1224x1684 1224x1684+0+0 8-bit PseudoClass 256c 1.967mb <-- this file out of my scanner
Deskewed/test.bmp BMP 1338x1766 1338x1766+0+0 8-bit DirectClass 6.764mb <-- this file out of "convert -rotate......"

I think this means that in the original file I have 256 levels of gray, and every pixel is 1 byte.
That's called a "PseudoClass". In the second I have 3 bytes/pixel, probably R G and B.
That's called a "DirectClass" (that's alot better, being "Direct" 'stedof "Pseudo";-)
but I end up wasting much space.

I tried to work with -quantize, colorspaces, etc but have not been able to get the deskewed
image in the same format as the original.
Can somebody help? Thank you very much in advance!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: .BMP file much larger than expected

Post by fmw42 »

try

convert image.bmp -deskew -type grayscale -depth 8 newimage.bmp

or

convert image.bmp -deskew -type palette -depth 8 newimage.bmp


see command

convert -list type

or review -type from http://www.imagemagick.org/script/comma ... ptions.php
Post Reply