Question
from PIL import Image import numpy as np def Chroma(image): arr = np.array(image) g=arr[:,:,1] b=arr[:,:,2] a = arr[:,:,3] r=arr[:,:,0] cond = 3*g>(2*b+2*r) a1 = a*(~cond)
from PIL import Image
import numpy as np
def Chroma(image):
arr = np.array(image)
g=arr[:,:,1]
b=arr[:,:,2]
a = arr[:,:,3]
r=arr[:,:,0]
cond = 3*g>(2*b+2*r)
a1 = a*(~cond)
arr[:,:,3] = a1
out = Image.fromarray(arr)
out.save('out.png')
origin = Image.open('fg_caster.png')
origin1 = origin.convert("RGBA")
test = Chroma(origin1)
raspberry pi python3
I made this code but it didn't work well
So, i'd like to change RGB into HSV and make green color into transparent..... can you help me with this?
##I should only use
import pygame, matplotlib, numpy, math
from PIL import Image, ImageDraw, ImageFont
##NO cv2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started