Converting to PNG you are on your own for (though what you fish out will be basic bitmap of a sort so no great hassles there). To actually fish it out then
http://problemkaputt.de/gbatek.htm#dscartridgeicontitle for the more technical side. No compression or encryption* should get in your way for this one.
Many many years ago I did have a thread around here.
https://gbatemp.net/threads/reading-the-nds-icon-data.45360/ is it and I covered a few things about the format, though the images which helped are long since gone. For the formats themselves I cover a bit in
https://gbatemp.net/threads/gbatemp-rom-hacking-documentation-project-new-2016-edition-out.73394/ but frankly it is fairly basic 2d game style formats rather than fun with alpha values or anything.
I don't know if any of the old DS ROM manager/checking tools went open source (or indeed if the source is still out there if they did, to say nothing of possibly not wanting to be bound to their licensing) but some might be.
*offhand I don't know what the encrypted form of DS ROMS some flash carts and release groups opted for at one point have. eNDryptS Advanced from
http://www.no-intro.org/tools.htm should give you an idea of what goes here by encrypting whatever you want to feed it to see. That will be the only encryption you have to deal with though unless your program supports passworded RAR files or something.