Skip to content

ДмитриЙ Мартынов#5

Open
klubnichniyvolk wants to merge 5 commits into
railbotan:mainfrom
klubnichniyvolk:main
Open

ДмитриЙ Мартынов#5
klubnichniyvolk wants to merge 5 commits into
railbotan:mainfrom
klubnichniyvolk:main

Conversation

@klubnichniyvolk
Copy link
Copy Markdown

No description provided.

Dima added 5 commits November 19, 2021 22:51
Comment thread test.py.txt Outdated

def get_pixel_color(self, arr, i, j):
color_sum = 0
for n in range(i, i + self.step):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

У вас у объекта класса pixelArtGenerator нет поля step

Comment thread test.py.txt
res = Image.fromarray(arr)
res.save('res.jpg') No newline at end of file

class pixelArtGenerator():
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

По PEP8 имя класса начинается с заглавной буквы

Comment thread test.py.txt
a1 = len(arr[1])
for i in range(0, a, self.step):
for j in range(0, a1, self.step):
color_sum = self.get_pixel_color(arr, i, j) // (10 * self.shag)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

pixelArtGenerator.get_pixel_color() у вас считает сумму всех цвета всех пикселей, а потом вы должны были поделить на 3 и еще на квадрат размера блока.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

В последнем комите вы делите на (10 * self.shag) внутри функции, а потом еще раз здесь

Comment thread test.py.txt
m3 = arr[n][m][2]
color_sum += int(m1) + int(m2) + int(n3)
return color_sum
def get_pixel_color(self, img_array, i, j):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Делим на квадрат размера блока

@railbotan
Copy link
Copy Markdown
Owner

Изменения надо было делать в файле filter.py

Comment thread test.py.txt
arr = np.array(img)
a = len(arr)
a1 = len(arr[1])
for i in range(0, a, self.step):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Поля step у вас нет

@railbotan
Copy link
Copy Markdown
Owner

По итогу ваш код не работает

@railbotan
Copy link
Copy Markdown
Owner

3

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