D
D
Dina Tarna2020-12-18 23:49:28
Python
Dina Tarna, 2020-12-18 23:49:28

How to change the color of image pixels whose x-coordinate is divisible by 2 and y-coordinate is divisible by 3 without a remainder in python-3?

I need to change the color of pixels whose x coordinate is divisible by 2 and the y coordinate is divisible by 3 without a remainder. In this case, these pixels must be painted white. I am using Anaconda/Jupyter environment.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Dugin, 2020-12-19
@adugin

import numpy as np

image = np.zeros((480, 640, 3), dtype=np.uint8)
image[::3, ::2] = (255, 255, 255)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question