WIMOPTIMIZE(1)
π wimoptimize(1) β the glow-up page for your WIM archives π
okay bestie, pull up a chair, this is the wimoptimize page from the User Commands section and it's literally about giving your WIM files a full makeover. no cap. π¦
β¨ NAME β¨
wimoptimize β optimize a WIM archive. that's it, that's the whole job, and she does it flawlessly. π
β¨ SYNOPSIS β¨
wimoptimize WIMFILE [OPTION...]
β¨ DESCRIPTION β¨
so wimoptimize, aka the twin sister wimlib-imagex optimize, rebuilds the standalone WIM archive WIMFILE. it writes the new WIM to a temporary file first, and then renames it over the original once it's ready β like changing outfits in the bathroom and only coming out when the fit is immaculate. π
the whole point? it removes any holes that got left in the WIM from appending or deleting files or images, so the new WIM may be smaller than the old one. decluttering queen behavior, honestly. β¨
by default, wimoptimize will reuse (not recompress) compressed data, and it will not change the solid or pipable status of the WIM. but bestie, she can do so much more β recompression and/or converting between solid, non-solid, pipable, and non-pipable WIMs are all on the menu. the options and examples below have the receipts. π
β¨ OPTIONS β¨
--checkβ before optimizing, verify the WIM's integrity if it contains extra integrity information. also include extra integrity information in the optimized WIM, even if it wasn't there before. trust but verify, and then verify again. π--nocheckβ do NOT include extra integrity information in the optimized WIM, even if it was present before. goodbye integrity info, you will not be missed. π--include-integrityβ include extra integrity information in the optimized WIM. it's like--check, except you don't also verify the WIM beforehand. same energy, less effort. π--recompressβ recompress all data in the WIM while optimizing it. this will significantly increase the time needed to optimize the WIM, but it may result in a better compression ratio ifwimlibcan do a better job than the program that created the WIM. and like β it probably can, especially if the WIM was Microsoft-created, becausewimlib's compressors are slightly stronger. πͺ not to be shady but. okay it's a little shady. π--compress=TYPE[:LEVEL]β recompress the WIM using the specified compression type, and optionally the specified compression level for that compression type. this implies--recompress. see the documentation for this option towimcapture(1)for more details. π--chunk-size=SIZEβ set the WIM compression chunk size toSIZE. see the documentation for this option towimcapture(1)for more details. π§©--solidβ create a "solid" archive that compresses multiple files together. this usually results in a significantly better compression ratio, but it has disadvantages such as reduced compatibility. see the documentation for this option towimcapture(1)for more details. trade-offs, bestie, trade-offs. βοΈ--solid-compress=TYPE[:LEVEL]β like--compress, but sets the compression type used in solid resources. see the documentation for this option towimcapture(1)for more details. π--solid-chunk-size=SIZEβ like--chunk-size, but sets the chunk size used in solid resources. see the documentation for this option towimcapture(1)for more details. π--threads=NUM_THREADSβ number of threads to use for compressing data. default: autodetect (number of processors). let the machine cook with every core it has. π₯--pipableβ rebuild the WIM so that it can be applied fully sequentially, including from a pipe. seewimcapture(1)for more details about creating pipable WIMs. by default, when neither--pipablenor--not-pipableis specified, the optimized WIM will be pipable if and only if it was pipable before. she preserves the vibe, she doesn't invent a new one. π«--not-pipableβ rebuild the WIM in the non-pipable format. ok so we're doing the other thing now. slay. π--unsafe-compactβ compact the WIM in-place, without using a temporary file. existing resources are shifted down to fill holes, and new resources are appended as needed. the WIM is truncated to its final size, which may shrink the on-disk file. this is more efficient than a full rebuild, but it is only supported when no recompression is being done. and more importantlyβ¦
β οΈ AN UNSAFE COMPACTION OPERATION CANNOT BE SAFELY INTERRUPTED! if the operation is interrupted, then the WIM will be corrupted, and it may be impossible (or at least very difficult) to recover any data from it. users of this option are expected to know what they are doing and assume responsibility for any data corruption that may result. fr fr, do not yolo this one. this is not the time for main character energy. π
β¨ NOTES β¨
wimoptimize does not support split WIMs or delta WIMs. for those files, consider using wimexport(1) instead. π«Ά
also, heads up: wimoptimize is roughly equivalent to:
wimexport WIMFILE all tmp.wim && mv tmp.wim WIMFILE
so yeah, that's the whole tea. π΅
β¨ EXAMPLES β¨
rebuild install.wim:
wimoptimize install.wim
rebuild AND recompress install.wim:
wimoptimize install.wim --recompress
rebuild and recompress install.wim using LZX ("maximum") compression at a higher-than-default compression level. the compression chunk size remains unchanged. this command will be slow, but it might be useful for optimizing files for distribution. see https://wimlib.net/compression.html for some benchmark results. π
wimoptimize install.wim --compress=LZX:100
recompress install.wim using solid-mode compression, then rename it to install.esd. this will decrease the archive size significantly. (also consider using wimexport install.wim all install.esd --solid.):
wimoptimize install.wim --solid
mv install.wim install.esd
turn install.esd back into install.wim:
wimoptimize install.esd --compress=LZX
mv install.esd install.wim
β¨ SEE ALSO β¨
wimlib-imagex(1) wimexport(1) wimverify(1) β go read those too, they're all part of the same friend group. π«
and that's the whole page bestie! this one shipped with wimlib 1.14.5, dated January 2026 β go forth and optimize, and pls pls pls be careful with --unsafe-compact. πβ¨π
π¦ where this page comes from
- arch rolling: wimlib 1.14.5-4 Β· LGPL-2.1-only OR LGPL-3.0-only
- fedora 43: wimlib-utils 1.14.5-1.fc43 Β· GPL-3.0-or-later AND MIT
- fedora 44: wimlib-utils 1.14.5-1.fc44 Β· GPL-3.0-or-later AND MIT
- nixpkgs unstable: wimlib 1.14.5
- ubuntu resolute: wimtools 1.14.5-1 Β· GPL3.0+-with-exception
- ubuntu stonking: wimtools 1.14.5-1build1 Β· GPL3.0+-with-exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms