how to make the output stop outputting when it is a precise rgb number

0 votes
I am a beginner using python so there are probably gonna be a lot of stupid errors. basically i'm trying to do a png reader that prints the rgb value of every pixel of the png, and "filter" the rgb color "85, 115, 184". Idk what i'm doing wrong. Thanks in advance

from PIL import Image

im = Image.open('x.png', 'r')

pix_val = list(im.getdata())
if condition:
pix_val != (85, 115, 184),
print (pix_val)
return
else:
pix_val = (85, 115, 184),
break
Dec 6, 2022 in Python by anonymous

edited 5 days ago 4 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP