For the IconClone app I could have simply tried to replace the images but then I would have to split the PNG Icons into two images to manipulate the data. But I would have to worry about preserving the icOn chunk data as well so I'm doing it differently.
Even if I used IconControlA to get the icon images I would still have to remake the icon file to infuse the new images and I would need to preserve the original icon attributes along with it. But the method I choose must work for PNG and IFF icon files.
I copy the source icon that has the proper images to a temp file in Ram Disk. I treat it as a complete file without splitting it. I must also consider the easiest way to deal with OS3.5 Icons. Treating them as complete files makes things much easier.
But then I must get two DiskObjects and copy all attributes from destination (original icon) to the temp icon. After the cloning process is complete I set filesize of destination icon to zero before writing binary to avoid extra IEND chunks when image sizes differ. I write temp icon directly to replace destination icon. The last part of the process is to delete the temp file and redisplay the new destination icon which now has new images.
Once everything is working correctly and after some cleanup I'll release the binaries and source code for everyone to enjoy.
I'm planning another small icon app called "IconColor" which also has double icon image displays.It will feature HSL Color Conversion to change icon color as @paolone says "on the fly".
The IconClone Application is contained in one code module so it can be easily compiled for AROS 68k or x86 or x86_64 as well.