I did successfully extract OS4 icon data (ARGB chunks) using Icon Library to save as PNG images.
miker1264 attached the following image:
With some assistance from PeterK I have made some progress with Icon Splitter on Amiga 68k using his Icon Library to decode ARGB chunks from OS4 icons.
According to Peter his newest icon Library on Aminet (46.4.589) & every version above 586 have the icon control tags for Set/GetARGBImageDat1/2 just like AROS Icon Library. So I had to replace the icon Library in libs on Caffeine OS. It was as easy as renaming the old icon.library and copy the new one.
I had to add the icon tags from AROS icon.h file into the Amiga icon.h file in AmiDevCPP with some changes. I had to use (ICONA_Dummy+301) through (ICONA_Dummy+304). After that the Amiga version of Icon Split compiled correctly. At the point in Process_ARGB function where it would normally use datatypes to save the PNG image data I instead used WriteData function to save a bin file. I saved a ImageData1.bin on AROS & Amiga.
Using HxD hex editor the binary files of image data are identical. So Process_ARGB is working but saving with Datatypes isn't working. At this point I can revise the Datatypes save function to work with Amiga or I could use png.h (PNG library) to write my own LoadPng/SavePng functions to save the ARGB image data.
It's getting interesting. Thanks to PeterK for his patience and for explaining the programming interface for his Icon Library (written in ASM).
AMIGASYSTEMDistro Maintainer Posted
16 days agoOttimo lavoro, Peter รจ una persona speciale sono contento che ti abbia dato una mano, la collaborazione porta sempre a grandi risultati.
AMIGASYSTEM
Thanks for the kind words.
Peter has helped quite a bit so that I can get the image data from the ARGB chunks for OS4 icons using his newest icon Library.
At this point for Amiga 68k now the data has to be saved to an output image file such as PNG. But I can't get the Datatypes code to work and using PNG library directly also has problems.
So as a proof of concept to prove that the image data is correct I'm going to use my code from the save function for Targa Datatype to save 32bit ARGB data directly to Targa Files. I hope that works. No libraries will be used for that.
Edited by miker1264 on 06-11-2024 12:59,
15 days agoSaving directly to 32bit Targa is working on AROS x86 to save the ARGB chunk data.
Now I need to compile the new code to test on Amiga 68k (Caffeine OS) on PiStorm32 Lite using PeterK's Icon Library (46.4.589) to extract the ARGB image data from OS4 icons to save Targa.
Saving to Targa is a placeholder for using Datatypes to save as PNG on Amiga 68k. I will change the output file path method to save the actual icon filename with _1, _2 appended to the name so that the user knows which icon images it is.
Edited by miker1264 on 06-11-2024 17:12,
15 days ago
miker1264 attached the following image:
Here is the Save Targa code that I'm using for AROS x86. We'll see if it works on Amiga 68k.
Targa and Windows BMP are very easy file formats to write to. Notice that for Targa (Truevision Graphics Adapter) the data can be RLE compressed using Targa RLE by pixel or it can be uncompressed.
The scanline data is reversed per scanline so that ARGB pixels becomes BGRA instead. Each scanline for Targa is then written from bottom to top of the file just like Windows BMP file format.
I chose Targa because it's an easy format and like PNG it can store 32bit image data. Most viewer programs that handle Targa only display it with an opaque background because most Targa files are 24bit. PaintDotNet and some other applications show it as transparent.
miker1264 attached the following file:
The Amiga 68k version of Icon Splitter can get the ARGB image data from OS4 icons using the ARGB Icon control Tags in PeterK's Icon Library. The image data is then saved directly to 32bit Targa files. (My Amiga Datatypes code isn't working yet ;-) )
This doesn't only apply to Caffeine OS, but any Amiga 68k or AROS 68k distribution that uses PeterK's Icon Library.
Icon Splitter is fully functional at the moment for both AROS x86, AROS 68k & Amiga 68k. It still needs some code cleanup before I can post it for further testing. I will include an archive of selected test icons of various styles or you can use your own icons to test with. The purpose of the Icon Splitter is to split icons into images to allow them to be edited with a paint program. In that way you can modify your own custom icons.
Edited by miker1264 on 09-11-2024 10:47,
12 days ago
miker1264 attached the following image:
AMIGASYSTEMDistro Maintainer Posted
12 days agoThanks miker, Icon Splitter will be very useful and fast on AROS to split icons, to do this before I had to use IconEditor AROS/Amiga version for DualPNG icons, and IconEditor OS 4.1 version for OS4 icons.
AMIGASYSTEMDistro Maintainer Posted
12 days agoI always have PeterK's most up-to-date library for both Amiga OS3 and AROS 68k versions, I have been using them for many years, even my AfAOne !
Attention to install the library on OS3.0 and 3.1 you must first disable the resident Icon.library, this is because the icon.library is included in the kickstarts.
Also for AfA OS you have to use the same procedure to disable the AFA OS native resident icon.library.
No problem instead for those using OS 3.5 and OS 3.9, with these OSes you only need to copy PeterK's icon.library in Libs.
AMIGASYSTEM
Thanks for the information. I'm using AmigaOS 3.9 so I just renamed the old icon.library then I copied the new one to libs. It worked nicely.
As an alternative to extracting the ARGB Images for OS4 icons on Amiga 68k you could use a small Script that PeterK includes with his Icon Library in a folder called "Bonus". The script is "ConvertToPNG" which uses ImageConverter by Thilo Koehler (I forget the name). It converts OS4 icons directly to Dual PNG Icons. But unless you modify the script to save separately it will overwrite the original OS4 icon without prompt. So if possible copy the OS4 icon to be converted to Ram Disk or another temp location so that the original won't be damaged.
After using ConvertToPNG you may then use IconSplit to split it into two PNG images if you'd like to edit the images. Or just use IconSplit to save ARGB chunks as Targa then use a paint program to convert Targa images to PNG. For AROS x86 the ARGB chunks are saved as PNG automatically using Datatypes.
Edited by miker1264 on 09-11-2024 14:36,
12 days agoAMIGASYSTEMDistro Maintainer Posted
12 days agoThanks for the info miker, I rarely split OS4.1 icons, a few times I have used IconEditor on OS4.1 emulated on WinUAE, usually for some developers I create OS4.1 icons always with IconEditor OS4.1 version
AMIGASYSTEM
Thanks for the contact information for PeterK. He has been very helpful by providing me with information about his Icon Library. So, with his assistance I was able to extract the ARGB Images to save to image files. That's an achievement.
In my country I have Monday off because we are honoring veterans. So I will spend much of today and tomorrow cleaning up the IconSplit source code so I can release the current version so I can move on to the next project - IconPress.
It will take about a week or two to write, re-write, edit and test the "Save_Amiga_Icon" function & the seven sub-functions needed to save Classic Amiga Icons (Glow Icons, OS4 ARGB Icons & AROS ARGB Icons). It's about 2000 lines of code that I have to edit & test to get it to save icons.
Happy Sunday!
Mike R.
Free food all day long. I think I ate too much. ;-)
IconSplit update 1.30 coming soon. It's in final testing.
Here is the Amiga 68k version with the archive of test icons. Of course, you can use your own icons to test. The syntax at the command line is just IconSplitter calculator.info (progName file.info). All split images will be saved to Ram Disk. The test icons can be used for AROS also.
For the Amiga 68k version you must have PeterK's Icon Library installed. It looks for version 51. The recommended version is 46.4.589 which can be found on Aminet.
Edited by miker1264 on 11-11-2024 14:13,
10 days ago
miker1264 attached the following file:
Here are the test icons for both Amiga & AROS.
miker1264 attached the following file: