Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / 16 Bit colour depth mode bug?

Author
Message
Viktor
22
Years of Service
User Offline
Joined: 7th Oct 2002
Location: Austria
Posted: 22nd Feb 2003 22:59
I was reading that images are stored internaly in R5,G6,B5 Bit format. Okay, that is true If I load a BMP or JPG, make image, store it in a memblock and read out the memblock.
But if I paint myself a Image, store it in a memblock and want to read it out, it is in R5,G5,B5 (15 Bit) bit format. Any idea why? I was looking for hours for the bug in BMP2SCR Pro, and this was it...
Is this a bug?
PC: AMD 1200/512 Mb SDR/GF2MX Dual Display/Win2000, 19" Monitor
ZX: Spectrum 128+ Customized version.
Current Project: BMP2SCR Pro (with LDIR)
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 23rd Feb 2003 03:23
nope... this is more a person who isn't aware of what they're doing (^_^)

an image saved in a memblock as 16bit format, is 5-6-5 ... this was told to us around 3-4months ago by Lee himself when i brought up this very issue.

if it has been changed it 5-5-5 16bit format then it is likely the final bit is because of the alpha on the screen, however it sounds more like you're saving it as such ... be interesting to see how your handling the colours, because DarkBasics RGB() will return a 32bit colour ... if you want a 16bit image then you have to save it yourself.

always did baffle me why it was never mentioned that you only have 16 and 32bit image memblocks, and that the RGB format was a 32bit value not a 16bit one (although i know it says its a dword return) ... plus there was never any explaination of 16bit formats - would've been nice as in Enhanced we never had RGBR, RGBG, RGBB

i'd go over your pixel routines to find out how your saving them

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Viktor
22
Years of Service
User Offline
Joined: 7th Oct 2002
Location: Austria
Posted: 23rd Feb 2003 20:37
You are right, I´m a baka!
I load a Bitmap and make a Memblock from Bitmap, then the Format is 5-6-5
I make a memblock from image. and the format is 5-5-5.
So I suppose that Bitmaps are 16 bits and images are 15 bit.
Bitmaps=16 bit
Images=15 bit...

PC: AMD 1200/512 Mb SDR/GF2MX Dual Display/Win2000, 19" Monitor
ZX: Spectrum 128+ Customized version.
Current Project: BMP2SCR Pro (with LDIR)
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 24th Feb 2003 00:17
maybe... seems odd because my images use a 16bit system - however how are you saving your images, because standard jpg is 5-6-5, whereas stand png is 5-5-5-1 the final bit being Alpha.
would really be alot better if DarkBasic Pro just imported everything into a native format ... guess i'll have to look into a DLL to do this, i'm sure i saw a global pointer for doing that

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Viktor
22
Years of Service
User Offline
Joined: 7th Oct 2002
Location: Austria
Posted: 25th Feb 2003 00:40
I´m saving the images via Savebitmap.dll from the Realgametools forum, and as far I know, JPG is a 24 bit only format, which does not support any alpha channel information, you mean surely BMP 16 Bit, which is 5-6-5. I don´t have a dll to save PNG images, but we give User the choice so save out BMP or JPG (quality 10-100), or in the native ZX Spectrum formats. Some aspects of DB Pro are still a big secret for me.

PC: AMD 1200/512 Mb SDR/GF2MX Dual Display/Win2000, 19" Monitor
ZX: Spectrum 128+ Customized version.
Current Project: BMP2SCR Pro (with LDIR)
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 25th Feb 2003 00:49
no i think you have that the wrong way around... there is no such thing as 16bit Bitmap

Jpeg is 16Bit (defualt is 5-6-5)
Bitmap is 2bit/4bit/8bit/24bit/(32bit) RGB/(Mask)
PNG is 16Bit (5-5-5 Alpha)

if the jpeg is saving in 5-5-5 format instead of 5-6-5 i'd talk to the developer about it ... if you really need the colour value, then my YCrCb to RGB will help out and can be found below - but you'll have to edit the Cr so it takes and equal share

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Viktor
22
Years of Service
User Offline
Joined: 7th Oct 2002
Location: Austria
Posted: 25th Feb 2003 21:26
Okay, 16 Bit bitmaps does not exist, but all my JPGs are 24 bit , maybe the compression changes it to 5-6-5, but Paint shop pro allways tells me that this are 24 bit images (16 Million colours).
PNG results the same bitmap depth information, and there is 8 bit PNG for sure too.
BMP 1 Bit exist too (it is monochrome), and I use it often.

But back again:
I´m cannot test which JPG format it saves, as I told you earlier, PSP shows not all informations about JPGs, but I believe, it is saved as 5-6-5 because it reffers to bitmap and not to image at saving.
Anyway, we changed the program now a bit, now there are two routines to read/write 16 bit pixel data. One for bitmaps and one for images.

PC: AMD 1200/512 Mb SDR/GF2MX Dual Display/Win2000, 19" Monitor
ZX: Spectrum 128+ Customized version.
Current Project: BMP2SCR Pro (with LDIR)
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 26th Feb 2003 03:01
but there is NO SUCH THING as 16Bit Bitmaps ... just as there are no such thing as 24Bit Jpegs - i seriously think you have these formats confused.

As for that i tested ALOT of formats just last week and any format that isn't 16Bit 5-6-5 is 32Bit RGBA (with the exception of Monochrome)

The only thing i could possibly think is that you are saving the Jpegs within 5-5-5 format yourself, and because DarkBasic doesn't convert to a native format it saves the original Bit format. But this still sounds very weird to me cause i tested almost 30 formats and non produced the results your stateing.

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Viktor
22
Years of Service
User Offline
Joined: 7th Oct 2002
Location: Austria
Posted: 27th Feb 2003 20:14
I did not mean JPG saving all the time, I was worried about the colour depth format using memblocks...
if you MAKE MEMBLOCK FROM IMAGE, your IMAGE is stored in 5-5-5 format. and MAKE MEMBLOCK FROM BITMAP stores bitmaps in 5-6-5 format. Look: BITMAP is not BMP File, it is a DB Pro internal representation of the display memory (The upper case letters did reffer to DB Pro instruction set). So there are 16 Bit BITMAPS, but no 16 Bit BMP´s.
Saving to Harddisk is not the problem. It is the internal representation in Memblocks, so that Images and Bitmaps are stored at two different formats.
I never said that my JPG´s are saved as 5-5-5.
If you wonder why I use 16 bit mode: One of the computers we´re using here, has a Voodoo 3 3000 AGP card (16 Mb) and our program won´t run on if if the depth is higher than 16 bit.

PC: AMD 1200/512 Mb SDR/GF2MX Dual Display/Win2000, 19" Monitor
ZX: Spectrum 128+ Customized version.
Current Project: BMP2SCR Pro (with LDIR)

Login to post a reply

Server time is: 2025-05-20 04:39:12
Your offset time is: 2025-05-20 04:39:12