flrs / blend_modes

Python package that implements image blend modes
MIT License
140 stars 29 forks source link

Applying BlendModes to JPGS #5

Closed cmooreml closed 3 years ago

cmooreml commented 6 years ago

Does anyone know how to apply blendmode to an JPG? I tried converting to ... but no luck.

rgba = cv2.cvtColor(img, cv2.COLOR_RGB2RGBA)
abi98213 commented 5 years ago

Same.

abi98213 commented 5 years ago

I got it work. Load image from PIL. img = Image.open('xyz.jpg') img = img.convert('RGBA') img = numpy.array(img) # Inputs to blend_modes need to be numpy arrays. img = img.astype(float) . It will work. So, convert to RGBA when it is PIL image will work

flrs commented 3 years ago

Closing this since it looks like we have a solution! Thanks, @mabdullahrafique for following up on this!