Page 1 of 1

.BMP file much larger than expected

Posted: 2011-01-20T08:05:36-07:00
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!

Re: .BMP file much larger than expected

Posted: 2011-01-20T11:59:55-07:00
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