Looking for testers for handler BMP3 Export

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Looking for testers for handler BMP3 Export

Post by capellan » Thu May 20, 2021 5:54 am

Now I understand...
Bye.
Last edited by capellan on Thu Jun 24, 2021 7:16 pm, edited 1 time in total.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Looking for testers for handler BMP3 Export

Post by FourthWorld » Thu May 20, 2021 8:26 am

Now I see what you were working on. Nice. I'll see if I can get some time to give this a workout next week. Thanks for posting this.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Looking for testers for handler BMP3 Export

Post by Klaus » Thu May 20, 2021 12:21 pm

Please allow naive questions:
What is this image format good for?
What are the dis-/advantages regarding other image formats?

I searched with Google but almost only got infos about a russian tank with that name! :-D

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Looking for testers for handler BMP3 Export

Post by capellan » Thu May 20, 2021 5:32 pm

Hi Klaus,

Using this crafted bmp header, you could export the imagedata of any Livecode image without loss (JPG) or compression (PNG). This format is useful for working with exact 8 bits RGB colors.

Main disadvantage is the file size.

Al
Last edited by capellan on Thu May 20, 2021 7:01 pm, edited 4 times in total.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Looking for testers for handler BMP3 Export

Post by Klaus » Thu May 20, 2021 5:35 pm

AHA, thanks for the info!

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Looking for testers for handler BMP3 Export

Post by capellan » Sat May 22, 2021 5:08 am

Hi Richard,

You are welcome! :D

I have added more information about the BMP3 Header
in this attached text document.

Code: Select all

- BMP3 Header explained -

This header allows to export Livecode Raw Imagedata
as a BMP3 file: 32 bits BMP with an alpha channel.

Only 12 bytes are changed:
- 4 bytes - Size of the BMP file in bytes.
- 4 bytes - Width of the BMP file in pixels. 
- 4 bytes - (Negative) height of the BMP file in pixels. 

It is necessary to use a negative height
to invert vertically the BMP file. That 
is because the BMP file format is read 
from bottom to top. 

Post corrections and comments in this thread in the Livecode Forum:
https://forums.livecode.com/viewtopic.php?f=8&t=35880

424D      - 2 bytes - The header field used to identify the BMP (BM in ASCII). 
8A30 0300 - 4 bytes - Size of the BMP file in bytes.  
0000      - 2 bytes - Reserved; if BMP was created manually can be 0.
0000      - 2 bytes - Reserved; if BMP was created manually can be 0. 
8A00 0000 - 4 bytes - Size of this header, in bytes.  
7C00 0000 - 4 bytes - Byte offset where bitmap imagedata starts. 
CC00 0000 - 4 bytes - Width of the BMP file in pixels. 
00FF FFFF - 4 bytes - (Negative) height of the BMP file in pixels.
0100      - 2 bytes - Number of color planes, must be 1.
2000      - 2 bytes - Number of bits per pixel. (in this case, 32 bits)
0300 0000 - 4 bytes - Compression method. (in this case, uncompressed RGBA)
4000 0000 - 4 bytes - Size of the raw bitmap data in pixels.
130B 0000 - 4 bytes - Horizontal Print resolution of the image.
130B 0000 - 4 bytes - Vertical Print resolution of the image. 
0000 0000 - 4 bytes - Number of colors in the palette. 
0000 0000 - 4 bytes - 0 means all colors are important. 
00FF 0000 - 4 bytes - The pixel format for Red channel.
0000 FF00 - 4 bytes - The pixel format for Green channel.
0000 00FF - 4 bytes - The pixel format for Blue channel.
FF00 0000 - 4 bytes - The pixel format for Alpha channel.
4247 5273 - 4 bytes - Color Profile (BGRs in ASCII)
- Begin Color Profile
0000 0000 0000 0000 0000 0000 0000 0000 
0000 0000 0000 0000 0000 0000 0000 0000 
0000 0000 0000 0000 0000 0000 0000 0000 
0200 0000 0000 0000 0000 0000 0000 0000
- End Color Profile
Al
BMP Header.txt.zip

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Looking for testers for handler BMP3 Export

Post by richmond62 » Sat May 22, 2021 10:01 am

Toussaint-Louverture-Haitian-1805.jpg
-
That worked excellently, BUT, the JPG image weighed in at 117 KB, while the BMP3
worked out as 2.5 MB.

Here on MacOS 11.5 beta . . .

Preview opened it.

GIMP opened it.

MediBang Paint Pro opened it.

Toussaint Louverture: a most amazing man!

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Looking for testers for handler BMP3 Export

Post by capellan » Wed Jun 23, 2021 11:38 pm

Solved with a single click! :D
Last edited by capellan on Thu Jun 24, 2021 7:29 pm, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Looking for testers for handler BMP3 Export

Post by richmond62 » Thu Jun 24, 2021 6:45 am

Because that is the image I tested with your stack. :)

And because I admire Toussaint Louverture.

And who decides what contributes what to a discussion?
Disk Space
is cheaper than Time...
I would hope you are not letting any political prejudices get in the way of anything.

Et Quel est l'avantage d'un BMP3?

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Looking for testers for handler BMP3 Export

Post by capellan » Thu Jun 24, 2021 6:21 pm

After reading phpbbb help, I solved
this with a single clic!

Amazing! :lol:
Last edited by capellan on Thu Jun 24, 2021 7:27 pm, edited 1 time in total.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Looking for testers for handler BMP3 Export

Post by Klaus » Thu Jun 24, 2021 6:34 pm

Actually all this is in the hands of the modarators of this forum! 8)

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Looking for testers for handler BMP3 Export

Post by capellan » Thu Jun 24, 2021 6:44 pm

............
Last edited by capellan on Thu Jun 24, 2021 7:28 pm, edited 1 time in total.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Looking for testers for handler BMP3 Export

Post by Klaus » Thu Jun 24, 2021 6:56 pm

Hola Aleajndro,
capellan wrote:
Thu Jun 24, 2021 6:44 pm
Klaus, Are you a moderador?
Yes, I am.
capellan wrote:
Thu Jun 24, 2021 6:44 pm
How did contribute Richmond posted image to this post?
Do you really think he should not have posted the image? Do you feel offended?
Come on, you must be kidding!? :shock:

This is way off, Sir!


Sincerely

Klaus

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Looking for testers for handler BMP3 Export

Post by capellan » Thu Jun 24, 2021 7:15 pm

Solved with a single click! :D

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Looking for testers for handler BMP3 Export

Post by Klaus » Thu Jun 24, 2021 7:29 pm

This is childish, Al!

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”