### 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)

p_out = (p_a + p_b + p_c + p_d) * 0.25f;
}
void Image::average_4_half(uint16_t &p_out, const uint16_t &p_a, const uint16_t &p_b, const uint16_t &p_c, const uint16_t &p_d) {
	p_out = Math::make_half_float((Math::half_to_float(p_a) + Math::half_to_float(p_b) + Math::half_to_float(p_c) + Math::half_to_float(p_d)) * 0.25f);
}
void Image::average_4_rgbe9995(uint32_t &p_out, const uint32_t &p_a, const uint32_t &p_b, const uint32_t &p_c, const uint32_t &p_d) {
	p_out = ((Color::from_rgbe9995(p_a) + Color::from_rgbe9995(p_b) + Color::from_rgbe9995(p_c) + Color::from_rgbe9995(p_d)) * 0.25f).to_rgbe9995();
}
void Image::renormalize_uint8(uint8_t *p_rgb) {
	Vector3 n(p_rgb[0] / 255.0, p_rgb[1] / 255.0, p_rgb[2] / 255.0);
	n *= 2.0;
	n -= Vector3(1, 1, 1);
	n.normalize();
	n += Vector3(1, 1, 1);
	n *= 0.5;
	n *= 255;
	p_rgb[0] = CLAMP(int(n.x), 0, 255);
	p_rgb[1] = CLAMP(int(n.y), 0, 255);
	p_rgb[2] = CLAMP(int(n.z), 0, 255);
}
void Image::renormalize_float(float *p_rgb) {
	Vector3 n(p_rgb[0], p_rgb[1], p_rgb[2]);
	n.normalize();
	p_rgb[0] = n.x;
	p_rgb[1] = n.y;
	p_rgb[2] = n.z;
}
void Image::renormalize_half(uint16_t *p_rgb) {