Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who's Online
3 user(s) are online (1 user(s) are browsing Forum)

Members: 2
Guests: 1

amiga, mordesku, more...

Browsing this Thread:   1 Anonymous Users



(1) 2 3 4 »


AROS BMP Picture DataType

Joined:
5/2 17:15
From California, United States
Group:
Member
Posts: 134
Offline

Attach file:



png  BMP DataType Testing3.png (211.84 KB)
6991_59fe5d9978d89.png 800X640 px

Posted on: 11/4 17:41
Transfer the post to other applications Transfer


Re: AROS BMP Picture DataType

Joined:
5/2 17:15
From California, United States
Group:
Member
Posts: 134
Offline
After spending several hours of testing with various BMP images both 24bit and 8bit of various sizes from 48x48 up to 800x600 I have made some observations about the current status of the Bitmap (BMP) DataType.

As you can see in the screenshot, there are some serious problems here! First, the BMP DataType can't save images!
When it is used to display images various strange things happen! 24bit BMP images appear perfectly. That's why Kitty was just laying around in the bottom right of the screen. Poor Gigi, on the other hand, on the left side of the screen got a work out! I stretched her in the Y and in the X many times to get different image widths and heights. Gigi is an 8bit image. Although 24bit images have no issues, nearly all 8bit images are displayed wrong!

The only exception are Marble.bmp and Vinyl.bmp which display just fine, though they are also 8bit images. One is 200x200 and the other is 128x128. I discovered that the Banding Effect that is seen in nearly every 8bit image, if it isn't black, happens when any 8bit image exceeds width=320, height=200. Anything larger than 320x200 will have the Banding Issue. So what causes it, and why are some images completely black? The blackness usually indicates no color palette associated with the image. Not sure at all why the weird banding effect is happening.

The code for the BMP datatype is overly and unnecessarily complicated. Even the smallest part is so obfuscated that it is difficult to understand what's going on. The Bitmap File Type is very simplistic, yet the datatype is overly complicated and very buggy! It is in no way similar to the IFF datatype which is very well written and well laid out. Much planning and good coding practices went into it. It is very easy to understand, it is well commented and it works very well. The IFF datatype just needs a save function. The BMP datatype uses a lot of bitwise operations that aren't needed, and it doesn't work.

The BMP Picture DataType will need to be completely re-written!

Posted on: 11/4 17:58
Transfer the post to other applications Transfer


Re: AROS BMP Picture DataType

Joined:
2004/10/30 17:13
From Ireland
Group:
Member
Posts: 2646
Offline
Hi Mike,

A few years back, I made some improvements to the BMP data type, but realised there was a lot more to do. I found an alternative that has the source available but not under an open source licence. I emailed the author, Gunther Nikl about relicensing but got no reply. If you want to try contacting him again it might be worthwhile. Perhaps I didn't use the right address.

Posted on: 11/5 7:41
Transfer the post to other applications Transfer


Re: AROS BMP Picture DataType

Joined:
5/2 17:15
From California, United States
Group:
Member
Posts: 134
Offline
ncafferkey,

Thank you for the information. I'll give that a try.

I was going through the code trying to fix the banding issue and the blackened images. I've made some progress. The 8bit images, as I suspected, that appear completely black is because no color palette is assigned. In my hex editor the biClrUsed is set to zero in those images. When it is zero it is supposed to be calculated using biBitCount. I confirmed the error with a simple test. I converted the 8bit to a 24bit using Paint.NET then back again to 8bit. The paint program reset biClrUsed to 256. Then the BMP datatype opened the image correctly. But there are still the banding issues to deal with. Haven't figured that out yet.

I've imported relevant parts of Load_BMP into my test program. I'll try to recreate the banding issue to try to figure out what is causing it in the 8bit images.

I'll try Gunther Nikl as well to see what happens.

BTW - I tried to join the Developers Mailing List. I sent an Introduction as the instructions indicated. Did anyone on the list receive that? I'm not getting any messages from the list other than notices of Nightly Builds. My email provider is yahoo. Would that cause a problem with the list?

Posted on: 11/5 19:10
Transfer the post to other applications Transfer


Re: AROS BMP Picture DataType

Joined:
2004/10/30 17:13
From Ireland
Group:
Member
Posts: 2646
Offline
Regarding the list, yes, I saw your introduction. Could it be filtered on your end?

Posted on: 11/5 19:20
Transfer the post to other applications Transfer


Re: AROS BMP Picture DataType

Joined:
5/2 17:15
From California, United States
Group:
Member
Posts: 134
Offline
Thanks for confirming. I'll check Junk Mail.

I'll send something to the list and see if I get a reply.

As far as Gunther Nikl, I found some information. Also, it shouldn't be difficult to work with what we have. We should only support Bitmap Images of 8bits per pixel and above. Personally, I have never seen anything less than 8bpp.

The Banding Effect on 8bit images is really a puzzle. It might be better to just re-write that part and keep the rest as is since it works for all images of biBitCount > 8.

Posted on: 11/5 19:40
Transfer the post to other applications Transfer


Re: AROS BMP Picture DataType

Joined:
2016/8/16 0:09
Group:
Member
Posts: 319
Offline
Quote:
miker wrote:
...
We should only support Bitmap Images of 8bits per pixel and above.
...

Why ?

Quote:

Personally, I have never seen anything less than 8bpp.

Amiga users usually use 8 or 16 colour icons. Earlier workbench uses even less colors.

Quote:

The Banding Effect on 8bit images is really a puzzle.

i have no idea what you meant by "banding effect" but i'm guessing that you are referring to modulo. It isn't too difficult to understand... Amiga's internal image storage make use of that as well, e.g. image width in memory is larger than actual width in pixels (unless width is divisable by 16 and/or 32).

Quote:

It might be better to just re-write that part and keep the rest as is since it works for all images of biBitCount > 8.

BMP image format is one of the most described image formats around. it shouldn't be too difficult to add support for images < 8 bpp. But, you can alway implement the 8(+) bpp first and see where that leads to, e.g. call another subroutine to handle images below 8 bpp.

Indexed, non-indexed, black&white, grey-scale, 5-5-6, 5-5-5... yes bmp image format sucks but so does iff and it's exotic formats such as EHB, HAM6, HAM8 etc.

Posted on: 11/5 23:21
Transfer the post to other applications Transfer


Re: AROS BMP Picture DataType

Joined:
2010/8/30 7:20
Group:
Member
Posts: 947
Offline
@miker

regarding ml its a bit quiet these days. i must admit i missed your introduction.

regarding gunther, i think he commented lately on amiga-news what concerns bebbos gcc6 backend for amiga-m68k. i might try to ask chris gutjahr about him and a possible contact.

Posted on: 11/6 1:03
Transfer the post to other applications Transfer


Re: AROS BMP Picture DataType

Joined:
5/2 17:15
From California, United States
Group:
Member
Posts: 134
Offline
origami,

Although it shouldn't be difficult to support images of bitdepths less than 8, it does add another level of complexity. Besides, I have no 4bit images to test with. Whatever is afflicting the 8bit images causing Banding, most likely also affects the ones at less than 8bits as well.

The BMP DataType already supports images less than 8bits. But I don't know if it works. I can't test those bitdepths.

By all means, if you have a 4bit BMP image over 320x200 simply open it in MultiView and see what happens. Open any 8bit BMP image file using MultiView and you can see for yourself. If it is above 320x200 there will be a banding effect. An image 800x600 for example will have six bands that are 100 pixels high from top to bottom. Each horizontal band is offset from the one below it. But the last band on the bottom is in the right position. I can't figure that one out. Any ideas what causes that?

Sometimes an 8bit image will appear black. But I found that if you look at it in a Hex Editor in the bitmapInfoHeader biClrUsed is set to zero (00 00 00 00). If it is (00 01 00 00) = 256, then all is well. In black images the color palette is missing.


Look at the screenshot I posted at the beginning of this topic.


Posted on: 11/6 14:14
Transfer the post to other applications Transfer


Re: AROS BMP Picture DataType

Joined:
5/2 17:15
From California, United States
Group:
Member
Posts: 134
Offline
Thanks wawa.

I found some of his work on Aminet.

I did receive some messages on the Mailing List but it's mostly quiet.

Posted on: 11/6 14:22
Transfer the post to other applications Transfer



(1) 2 3 4 »



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4359
2 magorium
magorium
4095
3 phoenixkonsole
phoenixkonsole
3892
4 nikolaos
nikolaos
3693
5 deadwood
deadwood
2923
6 ncafferkey
ncafferkey
2646
7 mazze
mazze
2214
8 clusteruk
clusteruk
2109
9 Kalamatee
Kalamatee
2024
10 damocles
damocles
1789
© 2004-2017 AROS Exec