You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So you actually want to use this in your code? idk why but here is how you do it. This library is basically "god mode" for images if you can ignore the fact that nothing else opens these files
Just open and save (The easy way)
If you aren't trying to be a hero, just use open and save
importwimf# open a file and get a WIMFImage objectimg=wimf.open("secret_stash.wimf")
# look at it using PILimg.pil.show()
# save it backwimf.save("copy.wimf", img.pil, quality=8)
Making it work with real stuff
If you do ML or actual work, you probably need arrays. We got you.
# get a normal numpy arrayarr=img.to_numpy()
# get an opencv bgr array because opencv is specialcv_img=img.to_opencv()
Quick metadata check
If you just want to see who made the file without loading 50MB of pixels:
If you fucked up the author name and don't want to re-encode the whole giant image, use this. It just swaps the JSON text in the file
withwimf.edit_meta("huge_file.wimf") asmeta:
meta['author'] ="Not a Hacker"meta['comment'] ="i fixed it"# file is updated when you exit the with block. magic.