ДмитриЙ Мартынов#5
Open
klubnichniyvolk wants to merge 5 commits into
Open
Conversation
added 5 commits
November 19, 2021 22:51
… расчете компонентов цветов и ошибка из-за которой картинка не до конца обрабатывалась
railbotan
reviewed
Nov 20, 2021
|
|
||
| def get_pixel_color(self, arr, i, j): | ||
| color_sum = 0 | ||
| for n in range(i, i + self.step): |
Owner
There was a problem hiding this comment.
У вас у объекта класса pixelArtGenerator нет поля step
railbotan
reviewed
Nov 20, 2021
| res = Image.fromarray(arr) | ||
| res.save('res.jpg') No newline at end of file | ||
|
|
||
| class pixelArtGenerator(): |
Owner
There was a problem hiding this comment.
По PEP8 имя класса начинается с заглавной буквы
railbotan
reviewed
Nov 20, 2021
| 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) |
Owner
There was a problem hiding this comment.
pixelArtGenerator.get_pixel_color() у вас считает сумму всех цвета всех пикселей, а потом вы должны были поделить на 3 и еще на квадрат размера блока.
Owner
There was a problem hiding this comment.
В последнем комите вы делите на (10 * self.shag) внутри функции, а потом еще раз здесь
railbotan
reviewed
Nov 20, 2021
| 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): |
Owner
There was a problem hiding this comment.
Делим на квадрат размера блока
Owner
|
Изменения надо было делать в файле filter.py |
railbotan
reviewed
Nov 20, 2021
| arr = np.array(img) | ||
| a = len(arr) | ||
| a1 = len(arr[1]) | ||
| for i in range(0, a, self.step): |
Owner
|
По итогу ваш код не работает |
Owner
|
3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.