AROS Exec

Distros => Icaros Desktop => Topic started by: miker1264 on September 21, 2019, 06:52:14 PM

Title: New BMPX Picture DataType
Post by: miker1264 on September 21, 2019, 06:52:14 PM
Here is the new bmpx datatype. This is the AVIv0 version.

It is about 98% complete. It will Load & Save BMP, BMPX.

I'm still working on 32bit BMPX Alpha Transparency.
Title: Re: New BMPX Picture DataType
Post by: salvatore on September 21, 2019, 08:19:24 PM
nice miker :)
Title: Re: New BMPX Picture DataType
Post by: miker1264 on September 21, 2019, 08:40:12 PM
It was tested somewhat on Icaros adesktop Hosted on Windows.
It should be considered experimental until you are sure it will work for you to Load and Save BMP's.

So don't delete the old BMP datatype and descriptor until you have tested BMPX. Move it to a storage folder.
You can't use both BMP & BMPX datatypes at the same time. BMP datatype has been superceded by BMPX.
 
Here is the source code for BMPX Picture DataType. It is released under AROS License as usual.
Title: Re: New BMPX Picture DataType
Post by: miker1264 on September 22, 2019, 02:41:21 PM
Revised source code for bmpx datatype.

This one has the makefile.bmpx file needed to compile the datatype.
Title: Re: New BMPX Picture DataType
Post by: miker1264 on September 25, 2019, 03:05:59 PM
Does anyone have information about the format and proper layout of the datatype descriptor source file *.dtd used to make descriptors for new datatypes?

I'm trying to make a new one but it's not quite working for me. If I use the old BMP descriptor it has to be initialized each time before use. I would like to make BMPX using createdtdesc so it works.
Title: Re: New BMPX Picture DataType
Post by: miker1264 on September 26, 2019, 08:04:56 AM
Congratulations! The New BMP Picture Datatype is now functional and ready for release.

Simply copy bmp.datatype to Sys:Classes/DataTypes and remove the old bmp.datatype

You can leave the BMP datatype descriptor in Sys:Devs/DataTypes. It's the same as the new one.

==========================================

It is recognized by MultiView as the BMP Picture Datatype.
It can Load Windows BMP files up to 24bit and 32bit BMPX files.
It can save 8bit and 24bit BMP files and 32bit BMPX files.

MultiView can display normal 32bit BMPX files using the new datatype but it can't display the
Alpha Transparency if the BMPX has an Alpha Mask. But this may be fixed in a later update.

Source code for version 1.0.0 will be uploaded soon.
Title: Re: New BMPX Picture DataType
Post by: wawa on September 26, 2019, 08:12:04 AM
btw considering your questions to dev ml, they might be answered sooner on our slack.
Title: Re: New BMPX Picture DataType
Post by: miker1264 on September 26, 2019, 08:17:59 AM
btw considering your questions to dev ml, they might be answered sooner on our slack.

Thank you. How do I get there?

Title: Re: New BMPX Picture DataType
Post by: Samurai_Crow on September 26, 2019, 10:36:35 AM
You need to be invited.  Check your PM.

Edit: never mind the PM.  I would need your email to generate an invite.
Title: Re: New BMPX Picture DataType
Post by: miker1264 on September 26, 2019, 01:28:50 PM
You need to be invited.  Check your PM.

Edit: never mind the PM.  I would need your email to generate an invite.

I sent you a message with my email.
Title: Re: New BMPX Picture DataType
Post by: mmartinka on September 26, 2019, 03:03:57 PM
Not correct show 1bit bmp format. The shows black picture only...

Congratulations! The New BMP Picture Datatype is now functional and ready for release.

Simply copy bmp.datatype to Sys:Classes/DataTypes and remove the old bmp.datatype

You can leave the BMP datatype descriptor in Sys:Devs/DataTypes. It's the same as the new one.

==========================================

It is recognized by MultiView as the BMP Picture Datatype.
It can Load Windows BMP files up to 24bit and 32bit BMPX files.
It can save 8bit and 24bit BMP files and 32bit BMPX files.

MultiView can display normal 32bit BMPX files using the new datatype but it can't display the
Alpha Transparency if the BMPX has an Alpha Mask. But this may be fixed in a later update.

Source code for version 1.0.0 will be uploaded soon.
Title: Re: New BMPX Picture DataType
Post by: miker1264 on September 26, 2019, 03:58:48 PM
I'll continue testing with all bitdepths. I only tested 8bit, 24bit and 32bit so far.

Thanks for the information. If you find any other issues with loading or saving please message me and I will try to verify it and correct the issue.

I made two small changes to the original load function to allow loading 32bit bmp images. One involved the colormap the other added pixel format and alignwidth, alignbytes to load 32bit bmp's. The rest is as it was. It was written by someone else whose name appears in the source code. I haven't tested all of it.

The AROS picture datatypes have been in a sad state for a long time, many missing save functions. I hope to fix as much as I can but there may be room for improvement on that.

Did you test the original bmp datatype to find if it can load 1bit and 4bit correctly? I haven't.
Title: Re: New BMPX Picture DataType
Post by: mmartinka on September 26, 2019, 06:56:52 PM
So sorry, but I'm mistake.  :o
According to this web pages. The 1bit bmp and 4bit format works well. With your datatype.bmp
Here:
http://entropymine.com/jason/bmpsuite/bmpsuite/html/bmpsuite.html (http://entropymine.com/jason/bmpsuite/bmpsuite/html/bmpsuite.html)

I have two 1bit bmp picture and they do not show correct.
here:
https://drive.google.com/file/d/1_1QUQzQcSmqT1A6kO_AQu4V1VWv9Bpp9/view?usp=sharing (https://drive.google.com/file/d/1_1QUQzQcSmqT1A6kO_AQu4V1VWv9Bpp9/view?usp=sharing)
https://drive.google.com/file/d/1iftSt4MpxXte9Mlc6R7BTHO11wNbk2U_/view?usp=sharing (https://drive.google.com/file/d/1iftSt4MpxXte9Mlc6R7BTHO11wNbk2U_/view?usp=sharing)
Title: Re: New BMPX Picture DataType
Post by: miker1264 on September 26, 2019, 07:10:00 PM
When I have some time I will take a look at your sample images and test 1bit and 4bit images with the old bmp datatype and new one to compare.

There are some sample bmp images in the AROS sources.

Title: Re: New BMPX Picture DataType
Post by: salvatore on September 26, 2019, 10:28:05 PM
thank you for your effort miker :)
Title: Re: New BMPX Picture DataType
Post by: magorium on September 27, 2019, 02:15:00 AM
Does anyone have information about the format and proper layout of the datatype descriptor source file *.dtd used to make descriptors for new datatypes?
You could try and use the Dtdesc tool (and accompanied documentation) from Olivier which you can find here: http://archives.aros-exec.org/index.php?function=showfile&file=utility/shell/dtdesc.i386-aros.tar.gz

I've used the same information for my IFF scanner (and which seems to work as expected ... at least for datatype descriptors  :) ).

Don't get entangled/lost in similar descriptors and priorities though  ;)
Title: Re: New BMPX Picture DataType
Post by: miker1264 on September 27, 2019, 04:43:47 AM
Does anyone have information about the format and proper layout of the datatype descriptor source file *.dtd used to make descriptors for new datatypes?
You could try and use the Dtdesc tool (and accompanied documentation) from Olivier which you can find here: http://archives.aros-exec.org/index.php?function=showfile&file=utility/shell/dtdesc.i386-aros.tar.gz

I've used the same information for my IFF scanner (and which seems to work as expected ... at least for datatype descriptors  :) ).

Don't get entangled/lost in similar descriptors and priorities though  ;)

Is dtdesc similar to createdtdesc?

I believe that the dt descriptor is related to the struct DataTypeHeader dth_Name, dth_BaseName, etc.

I've read about something similar for Amiga OS4 as dtdesc that has a user interface?

Thanks, I'll check it out.
Title: Re: New BMPX Picture DataType
Post by: miker1264 on September 27, 2019, 04:44:40 AM
thank you for your effort miker :)

Sure. No problem. I try very hard to make things work right.
Title: Re: New BMPX Picture DataType
Post by: miker1264 on September 27, 2019, 04:47:17 AM
When I have some time I will take a look at your sample images and test 1bit and 4bit images with the old bmp datatype and new one to compare.

There are some sample bmp images in the AROS sources.

I downloaded and opened your 1bpp images and some of my own. They all opened and displayed correctly.

Are you using Icaros Hosted or Native?
Title: Re: New BMPX Picture DataType
Post by: magorium on September 27, 2019, 05:56:31 AM
Is dtdesc similar to createdtdesc?
If i remember correctly it is similar in nature although if i recall correctly createdtdesc package is aimed at creating (picture) datatypes (as a whole, including makefiles). dtdescr is aimed at (only) viewing and creating the descriptor.

Although that in itself is not very exciting, it can be if you wish to create a new recognition filetype even though there is not an actual datatype in place. Or of course in case you wish to extend or 'overwrite' an existing descriptor (and in cases where you are not familiar with the build-system or wish to bypass that system).

Quote
I believe that the dt descriptor is related to the struct DataTypeHeader dth_Name, dth_BaseName, etc.
afaik that is correct. The accompanied readme implies as such  :)

Quote
I've read about something similar for Amiga OS4 as dtdesc that has a user interface?
I'm sorry to say that i'm not that familiar with OS4 tools/utilities so unfortunately i'm unable to tell.

Quote
Thanks, I'll check it out.
As long as it is useful to/for you then i'm glad i was able to help.
Title: Re: New BMPX Picture DataType
Post by: miker1264 on September 30, 2019, 03:30:52 PM
I've not made much progress with some other datatypes. But the good news is that BMP DataType is working. So I'll continue work on it.

I'll release the final version 1.0.0 later today and the source code for it under AROS License.
Title: Re: New BMPX Picture DataType
Post by: salvatore on September 30, 2019, 08:04:45 PM
than's :D
Title: Re: New BMPX Picture DataType
Post by: miker1264 on October 01, 2019, 05:25:59 AM
Here is the final release of version 1.0.0 for New BMP DataType.

In a future update I may add support to Load and Save 16bit, Save 1bit & 4bit, & Loading OS2 bitmaps.
Title: Re: New BMPX Picture DataType
Post by: miker1264 on October 02, 2019, 03:25:19 PM
Here is the metamake file for 64bit. I haven't tested it yet. Let me know if it works. ;-)
Title: Re: New BMPX Picture DataType
Post by: salvo on October 02, 2019, 05:28:15 PM
Thank you miker :D
Title: Re: New BMPX Picture DataType
Post by: miker1264 on December 12, 2019, 06:44:03 PM
paolone

I will send the current version of BMP Datatype to you later today to be included in version 2.3.0 if it isn't too late. The save functions work on Icaros 32bit but not yet 64bit. I'm still working on 64bit.

Thanks for your patience and for your hard work.
Title: Re: New BMPX Picture DataType
Post by: salvo on December 12, 2019, 10:14:09 PM
but is possible uploading on archives?
Title: Re: New BMPX Picture DataType
Post by: miker1264 on December 13, 2019, 02:33:49 AM
but is possible uploading on archives?

I suppose so but it's the AROS 32bit BMP Datatype that will also be comitted to AROS 64bit sources when that part is ready.

The binary is to be included with the next release of Icaros Desktop 32bit, hopefully. The 64bit version isn't ready yet. I'm still working on that part.
Title: Re: New BMPX Picture DataType
Post by: miker1264 on December 13, 2019, 05:35:32 AM
I have narrowed down the problems with the 64bit version of the AROS BMP Datatype.

Since PNM Datatype already works I substituted the Save_BMP function for the Save_PNM function.
There was a slight problem with the BitmapFileHeader & BitmapInfoHeader so I also substituted the PNM header for the BMP.
 
So by using MultiView 64bit to open a test pnm file then choosing "Save As" from the menu MultiView used the Save_PNM function which is actually Save_BMP.
The result was that it saved a 24bit file with a PNM P6 header and BMP pixel data which is stored upside down and RGB for a BMP is swapped to BGR so red and blue are reversed. You can see that it successfully saved the BMP data. So the problem with the 64bit BMP save function is in the BitmapFileHeader & BitmapInfoHeader or file signature at the beginning of the BMP file.
Title: Re: New BMPX Picture DataType
Post by: miker1264 on December 13, 2019, 07:26:34 AM
You should be pleased to know that the 64bit version of the AROS BMP Datatype now works with save functions for 8bit, 24bit BMP, and 32bit BMPX.

It will act as a prototype for save functions for other Picture Datatypes such as ILBM and maybe TGA and PCX.

I have attached the binary for the 64bit BMP Datatype for you to try out. After renaming the old bmp.datatype and copying this one in its place test it with Multiview. Open a BMP file in MultiView then choose "Save As" from the menu to Save a new BMP file to a new location. I usually save to Ram Disk: to test.
Title: Re: New BMPX Picture DataType
Post by: AMIGASYSTEM on December 13, 2019, 12:41:36 PM
miker will there also be a 32-bit and 68k version?
Title: Re: New BMPX Picture DataType
Post by: paolone on December 13, 2019, 02:06:42 PM
paolone

I will send the current version of BMP Datatype to you later today to be included in version 2.3.0 if it isn't too late. The save functions work on Icaros 32bit but not yet 64bit. I'm still working on 64bit.

Thanks for your patience and for your hard work.


Don't worry. You're not late at all. Development cycle for 2.3.0 will still be quite long, as we're adding a completely new way to use Icaros Desktop.
Title: Re: New BMPX Picture DataType
Post by: AMIGASYSTEM on December 13, 2019, 03:05:36 PM
I forgot miker "BMP Datatype_092519.zip" works well on my AROS One 32Bit, also saving in BMP works, only problem encountered on a BMP image that is seen doubled and distorted, on Windows and OS3 the image is seen well.
Title: Re: New BMPX Picture DataType
Post by: miker1264 on December 13, 2019, 04:06:52 PM
AMIGASYSTEM

Thank you for the feedback. I'll take a look at the problem with skewing. I've seen it before. It may be a problem with reading padding bytes in the original BMP load function. Thanks for the samples.

What bit depth is the black and white image? What is the width and height of the image? That will help me to duplicate the error to fix it. Thanks.

The 32bit and 64bit versions use exactly the same code. So now it's easier to update both.

I've noticed that 8bit BMP files that are an odd width such as 789x562 get skewed because of incorrect padding bytes in the older BMP Load function that existed before I added the BMP Save function. There are also colormap issues with 1bit and 4bit BMP files. They appear black. I will go back and correct these problems in the BMP Load function.

Then it should be very functional. Thanks.
Title: Re: New BMPX Picture DataType
Post by: miker1264 on December 15, 2019, 02:18:51 AM
I found the problem with 1bpp and 4bpp BMP files displaying as black because of a colormap issue. The problem was that BMP Load function was using biClrUsed which for 8bpp is usually defined, but for 1bpp and 4bpp biClrUsed is set to 0. Using biClrUsed is not optimal because these values are not required. So I used numcolors instead and based that on biBitCount. For 1bpp numcolors = 2 and for 4bpp numcolors = 16. So now these images display correctly with true colors.

For my BMP Save function I'm using a different method to calculate padding bytes than the method used in BMP Load. Now I will have to reconcile the two methods to find the best solution for BMP Load so that the padding bytes are handled correctly. For 8bit images if they are an odd size such as 789x562 they will be skewed.

Fixing the padding bytes issue is next then the new BMP Datatype will be complete. The next major revision will include Alpha Transparency for 32bit BMPX files. :-)
Title: Re: New BMPX Picture DataType
Post by: miker1264 on December 15, 2019, 05:44:28 PM
In addition to the ColorMap problem for 1bpp & 4bpp caused by using biClrUsed there was also an Offset error caused by something similar as seen below:

/* skip offset */
    bfOffBits = bfOffBits - 14 - 40 - biClrUsed*4;

If biClrUsed is set to zero, the last set of numbers will also be zero which gives a bad offset. So I changed biClrUsed to numcolors to correct the offset error.
Title: Re: New BMPX Picture DataType
Post by: miker1264 on December 15, 2019, 05:47:09 PM
After making the correction to resolve the offset error the result looked very good for 1bpp & 4bpp that previously had a split screen because of the offset error.

There is one more slight error in BMP Load that affects some 24bit images that have an odd width. This is caused by an error in calculating the padding bytes.

AMIGASYSTEM,

For the "Baggio.bmp" image I'm trying to reproduce the error based on Width & Bit Depth so I can calculate the padding bytes to find the skewing error. Is it 24bit with an odd width?



Title: Re: New BMPX Picture DataType
Post by: miker1264 on December 15, 2019, 06:53:05 PM
AMIGASYSTEM

I noticed that your screenshot was 800x600. Based on that I measured the size of the "Baggio.bmp" window to be about 310x250.
I did some quick calculations based on that assuming 24bit. That fits with the padding bytes error I've noticed due to a bad formula.

310x250

310%4 = 312
312*3= 936

(310*3)%4 = 932
932/3 = 310.6667

I have a bmp image that I resized to 310x250 at 24bit to test. I used the same size 310x250 image at 4bpp as a control sample.
The reslult was that the 24bit image with similar dimensions to your "Baggio.bmp" shows a definite skewing error due to padding bytes. Now I can fix that error as well.

Thank you for your feedback. That has helped narrow down this skewing problem.
Title: Re: New BMPX Picture DataType
Post by: AMIGASYSTEM on December 16, 2019, 11:10:13 AM
If it can serve you I enclose the image of Baggio.bmp (drawn by my son on PC with Paint)
Title: Re: New BMPX Picture DataType
Post by: salvo on April 13, 2020, 08:38:01 PM
miker it is possible to have the new bmpDT for my distribution :)
Title: Re: New BMPX Picture DataType
Post by: miker1264 on April 13, 2020, 09:44:33 PM
Yes. I will compile the newest one for 32bit.
Title: Re: New BMPX Picture DataType
Post by: salvo on April 13, 2020, 10:36:27 PM
thank you miker
Title: Re: New BMPX Picture DataType
Post by: miker1264 on April 14, 2020, 03:42:00 AM
This should be the latest 32bit version. Let me know if it works or if you have problems with it.
Title: Re: New BMPX Picture DataType
Post by: salvo on April 14, 2020, 02:56:28 PM
well miker, but raystorm :-\
Title: Re: New BMPX Picture DataType
Post by: miker1264 on April 14, 2020, 04:25:31 PM
I haven't been doing much lately but trying to survive the plague.
Title: Re: New BMPX Picture DataType
Post by: salvo on April 14, 2020, 06:57:41 PM
 ;D
Title: Re: New BMPX Picture DataType
Post by: salvo on April 20, 2020, 02:20:50 PM
miker you have corrected other datatypes :)
Title: Re: New BMPX Picture DataType
Post by: miker1264 on April 24, 2020, 03:02:56 AM
Yes. I have a few more.  :)
Title: Re: New BMPX Picture DataType
Post by: salvo on April 24, 2020, 04:52:49 PM
thank you miker ;)
Title: Re: New BMPX Picture DataType
Post by: miker1264 on February 02, 2021, 09:53:41 PM
The bmpx (bmp) datatype is finished. It should be available for 32bit.

I would post it to AROS archives? If I figure out how to upload.
Title: Re: New BMPX Picture DataType
Post by: aGGreSSor on February 02, 2021, 11:18:54 PM
The bmpx (bmp) datatype is finished. It should be available for 32bit.

I would post it to AROS archives? If I figure out how to upload.
I haven't watched it yet, but you are a great fellow that you not only started, but also brought it to the end.

0. It's good if you create a separate archive file for each architecture and specify the architecture in the filename.
For example 32-bit as "filename.i386-aros.lha".
Many uploaders neglect user-friendly naming, don't do that.  ;)

1. Go to http://archives.aros-exec.org , click "Submit" and click "Upload a new file (http://archives.aros-exec.org/index.php?function=submit)"

2. Fill in the fields carefully:

Category: datatype/image
Requirements: for i386-aros write the following: ABIv0; i386
Passphrase: read it (http://archives.aros-exec.org/help/help_passphrase.txt)

You have to upload it separately for aminet, don't pay attention to the aminet fields - this doesn't work.
See how I do (http://archives.aros-exec.org/index.php?function=showfile&file=game/platform/freeprince.i386-aros.lha), maybe you will like it and you will want to do the same.
3. Click on "Submit" button. If all required fields have been filled in, your release should appear on the "Uploads (http://archives.aros-exec.org/index.php?function=uploads)" page

After some time (a week or so) your release will be accepted and will appear on the "Recent (http://archives.aros-exec.org/index.php?function=recent)" page.
On the main page, according to my observations, releases appear after the approval of the next group (I might be wrong).
Title: Re: New BMPX Picture DataType
Post by: miker1264 on February 02, 2021, 11:23:55 PM
Thanks. I will upload it as soon as I can.