I've converted the png image to a base 2-bit sequence with the following program
from PIL import Image, ImageFile
from io import BytesIO
out = BytesIO()
with Image.open("download.png") as img:
img.save(out, format="png")
image_in_bytes = out.getvalue()
encoded_b2 = "".join([format(n, '08b') for n in image_in_bytes])
w = open("bitofimage", "w")
w.write(encoded_b2)
as a result, is a base 2. bit sequence
I CREATED A CRC PROCESS AND ADDED 8 BITS TO THE BIT SEW BEHIND IT.
And then convert back to PNG image with this code
a = open("bitadd_crc","r") //This Stream of bit has add with 8 bit crc
konv = a.read()
decoded_b2 = [int(konv[i:i + 8], 2) for i in range(0, len(konv), 8)]
with open('YANGDIKIRIM.png', 'wb') as f:
f.write(bytes(decoded_b2))
f.close()
w.close()
After being converted into an image again it worked, but when I unpacked it into a series of bits again, the 8-bit CRC added earlier was unreadable and converted into a part of the image. can anyone help me find the solution? I hope there is help to complete my final school assignment
Thanks for your help