### Godot version

2a0aef5f09

### System information

Windows 11, Ryzen 9 5950X, RTX 3090 (531.79) Vulkan, 64GB RAM

### Issue description

The issue occurs due to two things.
When textures/images are imported, the `fix_alpha_edges` / `fix_alpha_borders` function in the importer will modify the color values but leaves the alpha values unchanged.

Later, when using the `_convert` function in the `image.cpp` file or `Image::convert` to convert from `Image::FORMAT_RGBA` to `Image::FORMAT_L8` the following image results (raw on top, conversion on bottom).
![Clipboard - May 22, 2023 8_13 PM](https://github.com/godotengine/godot/assets/5207577/52f4597e-17b6-48c5-8fb4-d6d37012d8f4)

I, originally, thought that the `fix_alpha_edges` / `fix_alpha_borders` code was at fault but it turns out to not necessarily be the case.  I modified the `_convert` function in `image.cpp` to calculate grayscale values correctly and to consider the alpha channel or not and now I'm getting the expected output as shown here:
![Clipboard - May 23, 2023 7_16 AM](https://github.com/godotengine/godot/assets/5207577/73babb20-22bb-4f23-808f-5d49dce55f2d)


### Steps to reproduce

Import `Image::FORMAT_RGBA` image into any project.

Convert image in code by calling the `convert` function to `Image::FORMAT_L8`.

Screen shot of MRP here:
![image](https://github.com/godotengine/godot/assets/5207577/9d7d0078-5e41-45d1-b5c5-fc291b839fa9)


### Minimal reproduction project

Attached now
[Issue_77393.zip](https://github.com/godotengine/godot/files/11545149/Issue_77393.zip)

uint32_t src_yofs_frac = src_yofs_up_fp & FRAC_MASK;
		src_yofs_frac = src_yofs_frac >= FRAC_HALF ? src_yofs_frac - FRAC_HALF : src_yofs_frac + FRAC_HALF;
		uint32_t y_ofs_up = src_yofs_up * p_src_width * CC;
		uint32_t y_ofs_down = src_yofs_down * p_src_width * CC;
		for (uint32_t j = 0; j < p_dst_width; j++) {
			uint32_t src_xofs_left_fp = (j + 0.5) * p_src_width * FRAC_LEN / p_dst_width;
			uint32_t src_xofs_left = src_xofs_left_fp >= FRAC_HALF ? (src_xofs_left_fp - FRAC_HALF) >> FRAC_BITS : 0;
			uint32_t src_xofs_right = (src_xofs_left_fp + FRAC_HALF) >> FRAC_BITS;
			if (src_xofs_right >= p_src_width) {
				src_xofs_right = p_src_width - 1;
			}
			uint32_t src_xofs_frac = src_xofs_left_fp & FRAC_MASK;
			src_xofs_frac = src_xofs_frac >= FRAC_HALF ? src_xofs_frac - FRAC_HALF : src_xofs_frac + FRAC_HALF;
			src_xofs_left *= CC;
			src_xofs_right *= CC;
			for (uint32_t l = 0; l < CC; l++) {
				if constexpr (sizeof(T) == 1) { 
					uint32_t p00 = p_src[y_ofs_up + src_xofs_left + l] << FRAC_BITS;
					uint32_t p10 = p_src[y_ofs_up + src_xofs_right + l] << FRAC_BITS;
					uint32_t p01 = p_src[y_ofs_down + src_xofs_left + l] << FRAC_BITS;
					uint32_t p11 = p_src[y_ofs_down + src_xofs_right + l] << FRAC_BITS;
					uint32_t interp_up = p00 + (((p10 - p00) * src_xofs_frac) >> FRAC_BITS);
					uint32_t interp_down = p01 + (((p11 - p01) * src_xofs_frac) >> FRAC_BITS);
					uint32_t interp = interp_up + (((interp_down - interp_up) * src_yofs_frac) >> FRAC_BITS);
					interp >>= FRAC_BITS;
					p_dst[i * p_dst_width * CC + j * CC + l] = uint8_t(interp);
				} else if constexpr (sizeof(T) == 2) { 
					float xofs_frac = float(src_xofs_frac) / (1 << FRAC_BITS);
					float yofs_frac = float(src_yofs_frac) / (1 << FRAC_BITS);