Skip to content

Comments

Зекунов Владислав#6

Open
kekis01 wants to merge 4 commits intorailbotan:mainfrom
kekis01:main
Open

Зекунов Владислав#6
kekis01 wants to merge 4 commits intorailbotan:mainfrom
kekis01:main

Conversation

@kekis01
Copy link

@kekis01 kekis01 commented Nov 13, 2021

No description provided.

return count


def make_mosaic(arr, m_h, m_w, grad):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переменные m_h и m_w не совсем понятные.

size_h, size_w = input('Введите размер мозаики: ').split(',')
num_grad = int(input('Введите число градации: '))

make_mosaic(arr_img, int(size_h), int(size_w), num_grad)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мы задаем количество градаций и затем исходя от этого количества вычисляем шаг.

make_mosaic(arr_img, int(size_h), int(size_w), num_grad)

res = Image.fromarray(arr_img)
res.save(images[1] + ".jpg")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вместо конкатенации лучше использовать f-строки или string.format

@railbotan
Copy link
Owner

4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants