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
We are writing metadata to our png files and would love to when using upscaling have that data also copied over. Right now we are having to upscale, then re-open the image with PIL, read the metadata from the source image, then resave the upscaled image with this new data.
example of adding metadata to png files.
from PIL.PngImagePlugin import PngImageFile, PngInfo
targetImage = PngImageFile("pathToImage.png")
metadata = PngInfo()
metadata.add_text("MyNewString", "A string")
metadata.add_text("MyNewInt", str(1234))
targetImage.save("NewPath.png", pnginfo=metadata)
targetImage = PngImageFile("NewPath.png")
print(targetImage.text)
>>> {'MyNewString': 'A string', 'MyNewInt': '1234'}
any ideas if this is possible somehow, we would love to avoid saving the upscale, reading from original with metadata, loading the upscale again and saving the upscale. :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We are writing metadata to our png files and would love to when using upscaling have that data also copied over. Right now we are having to upscale, then re-open the image with PIL, read the metadata from the source image, then resave the upscaled image with this new data.
example of adding metadata to png files.
any ideas if this is possible somehow, we would love to avoid saving the upscale, reading from original with metadata, loading the upscale again and saving the upscale. :)
Beta Was this translation helpful? Give feedback.
All reactions