How to extract multiple images contained in HEIC file format?

I know that png file has lots of images inside of them. I just don’t know how to extract the images off it. Since the image has big file size means it has information of other images which is just kind of hidden due to apple wall garden stuff.

Wait? Now the png has lots of files? xD Please don’t make fun of us.

Btw here is the full metadata:

Big Sur.heic

<x:xmpmeta
	xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 6.0.0">
	<rdf:RDF
		xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
		<rdf:Description rdf:about="" xm
lns:aux="http://ns.adobe.com/exif/1.0/aux/"
			xmlns:dc="http://purl.org/dc/elements/1.1/"
			xmlns:xmp="http://ns.adobe.com/xap/1.0/"
			xmlns:xmpDM="http://ns.adobe.com/xmp/1.0/DynamicMedia/"
			xmlns:xmpMM="http://ns.ad
obe.com/xap/1.0/mm/"
			xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
			xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#"
			xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
			xmlns:xmpNot
e="http://ns.adobe.com/xmp/note/" aux:SerialNumber="JD010744" aux:LensSerialNumber="TF001846" aux:LensInfo="0/1 0/1 157525/56259 1029841/46811" aux:Lens="Schneider LS 55mm f/2.8" aux:ImageNumber="31129" aux:Firmware="IQ4 150MP, v5.01.0 (FWP)" dc:format="image/jpeg" xmp:MetadataDate="2020-08-20T23:12:15-10:00" xmp:CreatorTool="Adobe Photoshop 21.2 (Macintosh)" xmp:CreateDate="2019-11-06T08:01:25" xmp:ModifyDate="2020-
08-20T23:12:15-10:00" xmpDM:cameraModel="XF" xmpMM:OriginalDocumentID="xmp.did:0b1857e0-9788-6a46-9c04-fdb1b39791e5" xmpMM:InstanceID="xmp.iid:f26d88c7-6397-4775-adab-cc4f956f1cac" xmpMM:DocumentID="adobe:docid:photoshop:4ded6604-d5c9-fe45-97af-9b5851d7164e" photoshop:ColorMode="3" photoshop:ICCProfile="image P3" photoshop:LegacyIPTCDigest="4A1906169B00B54BBC60DC1A5152A72D" photoshop:DateCreated="2019-11-06T08:01:25" xmpNote:HasExtendedXMP="FF26175B7A58850FE751097F554232A8">
			<xmpMM:History>
				<rdf:Seq>
					<rdf:li stEvt:softwareAgent="Adobe Photoshop CC 2019 (Windows)" stEvt:changed="/" stEvt:when="2020-03-12T16:05:06-07:00" stEvt:instanceID="xmp.iid:0b1857e0-9788-6a46-9c04-fdb1b39791e5" stEvt:action="saved"/>
					<rdf:li stEvt:softwareAgent="Adobe Photoshop CC 2019 (Windows)" stEvt:changed="/" stEvt:when="2020-04-23T05:47:37-07:00" stEvt:instanceID="xmp.iid:64a98aea-8277-9048-a638-cf143888b36e" stEvt:action="saved"/>
					<rdf:li stEvt:action="converted" stEvt:parameters="from application/vnd.adobe.photoshop to image/png"/>
					<rdf:li stEvt:action="derived" stEvt:parameters="converted from application/vnd.adobe.photoshop to image/png"/>
					<rdf:li stEvt:softwareAgent="Adobe Photoshop CC 2019 (Windows)" stEvt:changed="/" stEvt:when="2020-04-23T05:47:37-07:00" stEvt:instanceID="xmp.iid:82e2e4a2-72c1-d447-b679-8636645c8e01" stEvt:action="saved"/>
					<rdf:li stEvt:softwareAgent="Adobe Photoshop CC 2019 (Windows)" stEvt:changed="/" stEvt:when="2020-04-23T18:58:31-07:00" stEvt:instanceID="xmp.iid:3a3d8ea2-46f6-ca4f-9c57-9a169903847a" stEvt:action="saved"/>
					<rdf:li stEvt:action="converted" stEvt:parameters="from image/png to application/vnd.adobe.photoshop"/>
					<rdf:li stEvt:action="derived" stEvt:parameters="converted from image/png to application/vnd.adobe.photoshop"/>
					<rdf:li stEvt:softwareAgent="Adobe Photoshop CC 2019 (Windows)" stEvt:changed="/" stEvt:when="2020-04-23T18:58:31-07:00" stEvt:instanceID="xmp.iid:86ef9e06-0f62-0848-be49-9eca2e0cb291" stEvt:action="saved"/>
					<rdf:li stEvt:softwareAgent="Adobe Photoshop CC 2019 (Windows)" stEvt:changed="/" stEvt:when="2020-04-27T13:41:37-07:00" stEvt:instanceID="xmp.iid:4c189ef4-768d-bf49-a3ad-a26b8c6592cd" stEvt:action="saved"/>
					<rdf:li stEvt:action="converted" stEvt:parameters="from application/vnd.adobe.photoshop to image/png"/>
					<rdf:li stEvt:action="derived" stEvt:parameters="converted from application/vnd.adobe.photoshop to image/png"/>
					<rdf:li stEvt:softwareAgent="Adobe Photoshop CC 2019 (Windows)" stEvt:changed="/" stEvt:when="2020-04-27T13:41:37-07:00" stEvt:instanceID="xmp.iid:e0bb8ad7-3d0e-d743-8c20-e5c5a6e4d62f" stEvt:action="saved"/>
					<rdf:li stEvt:softwareAgent="Adobe Photoshop 21.2 (Macintosh)" stEvt:changed="/" stEvt:when="2020-08-20T23:12:15-10:00" stEvt:instanceID="xmp.iid:58f37e07-588d-4ca0-9b84-241806a91218" stEvt:action="saved"/>
					<rdf:li stEvt:action="converted" stEvt:parameters="from image/png to image/jpeg"/>
					<rdf:li stEvt:action="derived" stEvt:parameters="converted from image/png to image/jpeg"/>
					<rdf:li stEvt:softwareAgent="Adobe Photoshop 21.2 (Macintosh)" stEvt:changed="/" stEvt:when="2020-08-20T23:12:15-10:00" stEvt:instanceID="xmp.iid:f26d88c7-6397-4775-adab-cc4f956f1cac" stEvt:action="saved"/>
				</rdf:Seq>
			</xmpMM:History>
			<xmpMM:DerivedFrom stRef:originalDocumentID="xmp.did:0b1857e0-9788-6a46-9c04-fdb1b39791e5" stRef:instanceID="xmp.iid:58f37e07-588d-4ca0-9b84-241806a91218" stRef:documentID="adobe:docid:photoshop:6f2647b7-0045-d84a-95f2-e3445a8574e5"/>
		</rdf:Description>
	</rdf:RDF>
</x:xmpmeta>

Big Sur.png

   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about=""
            xmlns:apple_desktop="http://ns.apple.com/namespace/1.0/"
            xmlns:tiff="http://ns.adobe.com/tiff/1.0/">
         <apple_desktop:solar>YnBsaXN0MDDSAQIDCFJhcFJzadIEBQYHUWxRZBAAEAGqCQ8SFhoeICMmKdMKCwwNDgZRYVF6UWkjQCQAAAAAAAAjQFkAAAAAAADTCgsMEBEHI8A5AAAAAAAAI0BRgAAAAAAA0woLDBMUFSPAIgAAAAAAACNAVAAAAAAAABAC0woLDBcYGSMAAAAAAAAAACNAVoAAAAAAABAD0woLDBscHSNAOQAAAAAAACNAW4AAAAAAABAE0woLDBsfHSNAb0AAAAAAANMKCwwNISIjQHBAAAAAAAAQBdMKCwwXJCUjQHDgAAAAAAAQBtMKCwwTJygjQHGAAAAAAAAQB9MKCwwQKgcjQHIgAAAAAAAACAANABAAEwAYABoAHAAeACAAKwAyADQANgA4AEEASgBRAFoAYwBqAHMAfAB+AIUAjgCXAJkAoACpALIAtAC7AMQAywDUANYA3QDmAOgA7wD4APoBAQAAAAAAAAIBAAAAAAAAACsAAAAAAAAAAAAAAAAAAAEK</apple_desktop:solar>
         <tiff:TileWidth>1024</tiff:TileWidth>
         <tiff:TileLength>1024</tiff:TileLength>
         <tiff:Orientation>1</tiff:Orientation>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>

Both were made with photoshop. and Both just contain one image.

No… it is a really high resolution lossless image (6016x6016):

$ file Big\ Sur.png 
Big Sur.png: PNG image data, 6016 x 6016, 8-bit/color RGBA, non-interlaced

:wink:

Sorry wasn’t trying to :cry: :disappointed_relieved:
I am not even basic in such stuff

It’ll be a tedious process with my approach
but you can extract the url
reconstruct them manually (because it is in two parts in the .xml file)
one at a time

then download it (you’ll get a .zip file)
extract it
you’ll get a folder “AssetData”
inside is the .heic file - it again contains 8 individual images

heif-convert ./AssetData/Big\ Sur.heic test1.png
just gave me 8 .png files

Tedious with my very crude approach, but it’ll work.

this is always the first part of the url:

https://updates.cdn-apple.com/2022/mobileassets/071-94709/78F78503-951B-4326-8D17-1DD080D276B6/

you can get this from the .xml like this:
egrep -o 'https?://[^"]+' xml\ file.txt

these are the different following parts that get you the specific image:

com_apple_MobileAsset_DesktopPicture/b261c85a4ec6ed6352e07efd33cbcba68b5c724d.zip</string>
com_apple_MobileAsset_DesktopPicture/bdf90ff33ec795f3dd9e72cd8cc78e1d5233b5c1.zip</string>
com_apple_MobileAsset_DesktopPicture/e55a3a911f108e830f8d42635c54e5a49f313c46.zip</string>
com_apple_MobileAsset_DesktopPicture/76adce695d07d734a25aa15f7c3cc83c8095e2f7.zip</string>
com_apple_MobileAsset_DesktopPicture/09ae50d90559109fe02d6efd2bac17ac1e45bada.zip</string>
com_apple_MobileAsset_DesktopPicture/21812642b3d0f9f1cb08fec1131e6b76f9da30ce.zip</string>
com_apple_MobileAsset_DesktopPicture/71d07e216ac5b8caf2592eac876c1ad6f4a4612a.zip</string>
com_apple_MobileAsset_DesktopPicture/252ebc0b111ff367ee48bfef76866ea7a156978f.zip</string>
com_apple_MobileAsset_DesktopPicture/3fa4e84cc1dd3b4209c0f360b323488d29c4e872.zip</string>
com_apple_MobileAsset_DesktopPicture/3d64990406dba19ce13e5a946aad74813700d3ca.zip</string>
com_apple_MobileAsset_DesktopPicture/414a9be7c1d14bb1dff4ca915ce4ba597991206a.zip</string>
com_apple_MobileAsset_DesktopPicture/0231e53a0c6a60124328cec5b9a5a3d78bc93a6b.zip</string>
com_apple_MobileAsset_DesktopPicture/ddfb5ccd7b4bd04b22eba62bf57dfdcd323ba6ad.zip</string>
com_apple_MobileAsset_DesktopPicture/9d578237087ddee7375215c37bd5a0b614d4c854.zip</string>
com_apple_MobileAsset_DesktopPicture/3eadc7aca4c1db53c50c2d2a964980919791a295.zip</string>
com_apple_MobileAsset_DesktopPicture/3082870279bea9f1999352bca0c987efdcf54710.zip</string>
com_apple_MobileAsset_DesktopPicture/f33144fbcf2fea5807a4d9342d0a16d5446a3b60.zip</string>
com_apple_MobileAsset_DesktopPicture/809b40e887b6efb90799ce0566ececbb3cab7189.zip</string>
com_apple_MobileAsset_DesktopPicture/e20fe426ba331a10d5cc5030d6063664a012a287.zip</string>
com_apple_MobileAsset_DesktopPicture/9a9e2a75adb7b96fc040560ba7e1f2dfbe8a84ea.zip</string>
com_apple_MobileAsset_DesktopPicture/81c343161410f228a015da28a2d97478a83ba549.zip</string>
com_apple_MobileAsset_DesktopPicture/2b93be0c1428a586f2b9cab868afca8b1ea95556.zip</string>
com_apple_MobileAsset_DesktopPicture/1d78201c7f71fd653d333e974bc8e69c6a52719c.zip</string>
com_apple_MobileAsset_DesktopPicture/3b77a0bcf564bf31f0a2f521e819146503f58c74.zip</string>
com_apple_MobileAsset_DesktopPicture/884a37504b98839c5a7bcb73477fb389444e56ce.zip</string>
com_apple_MobileAsset_DesktopPicture/2c954f3a0fbdcfbfbb07ef2102ac320023b50895.zip</string>
com_apple_MobileAsset_DesktopPicture/b591fafebc87afbedd5adc3ca7c5642c0d93dabe.zip</string>
com_apple_MobileAsset_DesktopPicture/8f593482d969dbb9ca9153a104f9655030d8dec0.zip</string>
com_apple_MobileAsset_DesktopPicture/921ecc6840d79d7ca99431705c2a6800e7cb89bb.zip</string>
com_apple_MobileAsset_DesktopPicture/71b06237f097a183f5e4c01fbea4262f08d9ec15.zip</string>
com_apple_MobileAsset_DesktopPicture/fa62c551baec5f151f94e37079ccf32ab14a1979.zip</string>
com_apple_MobileAsset_DesktopPicture/25fc9539133a3ee2e2fc603e47b71b3bb625c83a.zip</string>
com_apple_MobileAsset_DesktopPicture/1617f14c360b271dd4ee7cc49cf68a96cdc4f3c6.zip</string>
com_apple_MobileAsset_DesktopPicture/2727318632b2a06fb1331891e2972c7a98d47a1b.zip</string>
com_apple_MobileAsset_DesktopPicture/53aea496bd5c73cf0aca887f11327b415933d71a.zip</string>
com_apple_MobileAsset_DesktopPicture/93cab43e71aeb91043836491c10b98359ba774dd.zip</string>
com_apple_MobileAsset_DesktopPicture/155a77bee1f376a728726f88f0bae57247fc024d.zip</string>
com_apple_MobileAsset_DesktopPicture/f5ce12854c70d52edb6eb78a76aa9ba6fcc54e92.zip</string>
com_apple_MobileAsset_DesktopPicture/db69deeb7bcb6e1bb37b993aede64de553723b5b.zip</string>
com_apple_MobileAsset_DesktopPicture/745eeb24965cb54948ae05472271b2042ab079e3.zip</string>
com_apple_MobileAsset_DesktopPicture/9ff4ddc895b4da3afdcd231a88f8d8fc79303213.zip</string>

you can get this list like this:
egrep -o 'com_apple[^"]+' xml\ file.txt

It can be refined - but I’m no grep guru.

one final url will be:
https://updates.cdn-apple.com/2022/mobileassets/071-94709/78F78503-951B-4326-8D17-1DD080D276B6/com_apple_MobileAsset_DesktopPicture/b261c85a4ec6ed6352e07efd33cbcba68b5c724d.zip

fetch it with wget:
wget https://updates.cdn-apple.com/2022/mobileassets/071-94709/78F78503-951B-4326-8D17-1DD080D276B6/com_apple_MobileAsset_DesktopPicture/b261c85a4ec6ed6352e07efd33cbcba68b5c724d.zip

or, now that all the url’s are here in plain sight - just copy/paste to construct you url’s

unzip the downloaded .zip file
and extract the images from the .heic file

1 Like

Everything went over the head !!
But I will try
Do you mean you were able to extract all of those images ?

yes - you did not comprehend, but I described the process

I have tried only one of the many - because it’s a lot of data

Try to run the two commands on your .xml file and you’ll see, hopefully :nerd_face:

first part of the url is right there
and the second part is in the long list below

the final url for the first one in the list is also there, as well as the command to fetch it

1 Like

You definitely have something else there. Let me explain:

  • GIMP 2.10.22 will recognize .heic files and open them, with a popup to select what image from those inside the .heic to be loaded

That is the way it works on my end and the same should do on your end, and has the same number of “layers” as you showed here

  • If i extract the images from it via terminal, as mentioned before, i run:
magick convert Big\ Sur.heic Big_Sur.png

Yes, files that have space in their name require the \
I end up having all the “layers” extracted from it as .png files and all have the same resolution 6.016 × 6.016 as the original heic file, and there are 8 png files.

I got 8 out of the file I just downloaded like described above. :nerd_face:

1 Like

Man Everything is getting over my head !!
I think I should sleep today and continue tomorrow !!

@bogdancovaciu
did you do all of that in your mac book or linux ?

take your time - and study the contents of the .xml
Just look - you’ll see the url’s in there

what I did was to extract those lines
to make it easier to reconstruct the url you need to download one by one

once you have them you can unzip and then extract each one - a tedious process

For sure the process can be made better - but that will be specific to that one .xml and is not worth investing the time.

Are 8 on my end too, just had a typo :rofl: 0 to 7 are 8

I’m all linux. MacOS died for me after Lion.

I wish I had big brain like you guys have !!
I will definitely try both method you guys told me.
Thanks a lot to @megavolt @Nachlese @bogdancovaciu :slight_smile:

It’s not so much big brains - a lot of it is simply experience, knowing where to look and for what and then connecting the dots.

1 Like

Yeah !! It is working as well but it seems like I just have gimmick heic files.
I need to figure out where the actual heic files are and then use the command on it.

you likely don’t even have them - download them like I described
I didn’t work on any of your files - I used the one I downloaded.

1 Like

For sure I will !! because I don’t have any other option
Is it okay for you if I ask stupid question regarding this in personal dm ? :sweat_smile:

… it depends on the level, I guess :sunglasses:
just try

1 Like

Will try upper level question :slight_smile:

Okay !! For the rest watching this and want to know the soultion.

Credit for solution: @bogdancovaciu @megavolt @Nachlese
Firstly the multiple images off the heic file can be extracted using heic-convert program from libheif package and magick program from image magick program (normally preinstalled in gimp).
I also found from @bogdancovaciu that gimp too support this feature in 2.1 version.
The reason I was in trouble was I was trying to convert a heic file that was just a thumbnail. With help of @Nachlese I found how apple was trying to confuse us with it’s gimmick heic file that I had in my system. He gave me the location from where I can install the compressed zip file after which I simple followed. This procedure.

$ wget https://location of apple wallpaper containing that heic file
$ magick file.heic file.png

It seems a bit over the head at first but it is just a step away. Here is one example:

$ wget https://updates.cdn-apple.com/2022/mobileassets/071-94709/78F78503-951B-4326-8D17-1DD080D276B6/com_apple_MobileAsset_DesktopPicture/0231e53a0c6a60124328cec5b9a5a3d78bc93a6b.zip     

extract this file and then go into the Asset folder where you will find the heic file
then…

magick convert Big\ Sur.heic Big\ Sur.png

Hope you have a wonderful day :slight_smile: