and
I want to export an image that just has the red "Hello" like:
So I am running a simple deduction python script:
from PIL import Image
import numpy as np
root = '/root/'
im1 = np.asarray(Image.open(root+'1.jpg'))
im2 = np.asarray(Image.open(root+'2.jpg'))
deducted_image = np.subtract(im1, im2)
im = Image.fromarray(np.uint8(deducted_image))
im.save(root+"deduction.jpg")
But this returns:
rather than the above. What am I doing wrong? Also do I need numpy or can I do this with just the Pillow Library?
Edit:
It should also work with images like this:
which my code returns:
Confused as to why it is so pixelated around the edges!






