diff --git a/helpers.c b/helpers.c index c7db2d4..c95d4a0 100644 --- a/helpers.c +++ b/helpers.c @@ -8,7 +8,7 @@ void grayscale(int height, int width, RGBTRIPLE image[height][width]) { for (int j = 0; j < width; j++) { - int avg = round((image[i][j].rgbtBlue + image[i][j].rgbtGreen + image[i][j].rgbtRed) / 3); + int avg = round((image[i][j].rgbtBlue + image[i][j].rgbtGreen + image[i][j].rgbtRed) / (float) 3); image[i][j].rgbtBlue = image[i][j].rgbtGreen = image[i][j].rgbtRed = avg; } }