From: Mayayana <mayayana@invalid.nospam>
Subject: Re: Windows freeware to lock in a 3: or 4:3 aspect ratio for cropping
Full headers:
From: "Mayayana" <mayayana@invalid.nospam>
Subject: Re: Windows freeware to lock in a 3: or 4:3 aspect ratio for cropping
Date: Sun, 18 Feb 2018 13:53:13 -0500
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <p6ci3b$cj9$>
References: <> <p6alqc$sk5$> <170220182050480435%nospam@nospam.invalid> <n0lmy7amjq04$> <p6at15$1l2$> <1mhlk1hlrt2ul$>
Injection-Date: Sun, 18 Feb 2018 18:53:31 -0000 (UTC)
Injection-Info:; posting-host="05c5d2c7a9d23e6aa882f9a4bb5f929f";
logging-data="12905"; mail-complaints-to="";posting-account="U2FsdGVkX1/rTchTNwDTmQaE7B/D/Wgc2yrW51YIYgQ="
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
Cancel-Lock: sha1:Iv8viR42uTH9KNUBS/1XoB3NazQ=
X-Priority: 3
X-MSMail-Priority: Normal
Print Article
Forward Article
"JJ"<> wrote

| I know that BMP stores image data uncompressed. But I also know that it
| stores a 24bpp (RGB) pixel in a DWORD (4 bytes) storage. That's 25% waste.

  Not actually. It requires a scan line divisble by 4. Maybe
that's what you're thinking of. But that's just for building
the file. As a DIB it's just 3 bytes per pixel. If you create
a 10x10 white BMP and save to disk you can see it clearly.
Each horizontal scan line is 30 bytes. 10 pixels at 3 bytes
each. If you look at it in a hex editor you'll see 2 null bytes
after each 30 FF bytes, rounding up each line to 32 bytes.
The width and height are in the header, so Windows will
unpack it accordingly. And the loaded DIB will be just 300
bytes of value 255.

 Thus: 10x10 BMP @ 374 bytes. 54 byte header. 300 bytes
for 100 pixels of data. 20 bytes scan line padding. If the
image is something like 800x600 the padding, if any, will
be negligible. In fact, with 800 x 600 it's zero:
800 pixels wide x 3 bytes per pixel = 2400 bytes per scan
line, which divides evenly by 4.

   The pixel value can be handled as a DWORD/long integer
but it's only actually 3 bytes of data. One byte for each
RGB. (Notice the color picker ion any graphic editor.
Typically it's a 6 character hex code. 3 bytes. 24-bit.

  A PNG has to store 4 bytes for the alpha channel
AKA transparency percentage value of the pixel. But
for BMP it's just 3 pixels.