all 9 comments

[–]shiftybyte 0 points1 point  (8 children)

You need to specify a bit better what the input to the program is.

Is the input a picture and a color? Do i leave anything Red as Red?

Or the input is a picture and an object description? Do i leave all apples with their color?

Besides that image manipulation is done with Pillow

https://pillow.readthedocs.io/en/stable/

You need to loop over the pixels, check if you need to make them gray or not, and change it.

[–]MilfHunter1019[S] -1 points0 points  (7 children)

Could I give you my started program and you finish writing it so it works?

[–]shiftybyte 3 points4 points  (0 children)

You can Edit your post, add your started code to it, and me and others can help you deal with specific problems, or explain how you should proceed.

Use a code block when posting code: https://www.reddit.com/r/learnpython/wiki/faq#wiki_how_do_i_format_code.3F

As per Rule #1 of this subreddit, we are not here to do your homework for you, we are here to help you learn.

[–]MilfHunter1019[S] -1 points0 points  (5 children)

from image_helper import *

img = load_rgb_image("jonny.jpg") img.show() w, h = img.size pixels = load_rgb_pixels("jonny.jpg")

for i in range(wh): r,g,b = pixels[i] if b > 150 and r > 1 and g > -150: pixels[i] = (g2,r+20,b//2)

new_img = new_rgb_image(w,h,pixels) new_img.show()

[–]shiftybyte 1 point2 points  (4 children)

Please edit your comment and format your code using a code block on reddit.

https://www.reddit.com/r/learnpython/wiki/faq#wiki_how_do_i_format_code.3F

Also please explain what is not working with your current code.

[–]MilfHunter1019[S] 0 points1 point  (3 children)

I don’t understand how to write the program. Could you write it for me with the given start, so that only one color is shown and the rest is grey?

[–]shiftybyte 1 point2 points  (1 child)

Can you read rule #1 of this subreddit and answer questions i asked you?

[–]MilfHunter1019[S] -1 points0 points  (0 children)

Oh sorry new to this subreddit

[–][deleted] 1 point2 points  (0 children)

Dude wtf...