I´m new to this and I tried to find ways to solve this in the internet or even AI but everything I try is not working.
I am currently trying to substract a picture I put in another picture within the Hex. I am working with PyCharm (Python 3.12) and installed Pillow and pip.
But its telling me:
Traceback (most recent call last):
File “C:\Users\guest\PycharmProjects\PitureProgramming\second.py”, line 10, in
new_image = PIL.Image.open(io.BytesIO(f.read()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\guest\PycharmProjects\PitureProgramming\venv\Lib\site-packages\PIL\Image.py”, line 3305, in open
raise UnidentifiedImageError(msg)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x0000023F09B8D3A0>
THANK YOU SO MUCH.
My code wasnt wrong I just forgot to reset the picture (I added text to the bytes before i chose to put a picture in it).
So it wont work if its already been manipulated.
Since you talked about what could be possibly wrong with the picture itself i checked it again in the Hex and then i saw what made it not work. I then deleted the added bytes and now its all fine!
Thank you for your hint.