I have made some mathematical operations on some grayscaled images in python using numpy.
Now I want to upload the resulting numpy arrays as png images to my S3 bucket. I have tried to upload them as base64 formats, but in that way I cannot open them as images from S3. My code looks as follows:
dec=base64.b64decode(numpy_image)
s3.Bucket('bucketname').put_object(Key='image.png',Body=dec, ContentType='image/png',ACL='public-read')
When I try to open the file from S3 it says that the file contains an error