Same texture, same filtering steps, but quality loss when I use it as array texture

I have a problem using texture array, when I tried it looks with blur, but when I use it as a single texture looks excellent (I am testing just with one texture to compare the quality), I am using the exactly same filtering steps for each process.

Here the code when I load as a single:

	glGenTextures(1, &texture);
	glActiveTexture(GL_TEXTURE0);
	glBindTexture(GL_TEXTURE_2D, texture);

	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT);

	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, max_anisotropy_value);

	unsigned char *data = stbi_load(filePath, &width, &height, &nrChannels, 0);
	if (data)
	{
		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data);
		glGenerateMipmap(GL_TEXTURE_2D);
	}

And Here when I load as a texture array:

	glGenTextures(1, &my_texture);
	glActiveTexture(GL_TEXTURE0);
	glBindTexture(GL_TEXTURE_2D_ARRAY, my_texture);

	glTexStorage3D(GL_TEXTURE_2D_ARRAY,
		5 // I tested from 0 to 10 and clearly with each increase value blur increases!!,
		preformat,
		resolution, resolution,
		(GLsizei)files_.size()
	);

	glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT);
	glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT);
	glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
	glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, max_anisotropy_value);

	for (GLuint i = 0; i < files_.size(); i++)
	{
		if (data[i])
		{
			glActiveTexture(GL_TEXTURE0);
			glBindTexture(GL_TEXTURE_2D_ARRAY, my_texture);

			glTexSubImage3D(GL_TEXTURE_2D_ARRAY,
				0,                     //Mipmap number
				0, 0, i,               //xoffset, yoffset, zoffset
				resolution, resolution, 1,               //width, height, depth
				format,                //format
				GL_UNSIGNED_BYTE,      //type
				data[i]);                //pointer to data

			stbi_image_free(data[i]);
		}
	}	

	glBindTexture(GL_TEXTURE_2D_ARRAY, my_texture);
	glGenerateMipmap(GL_TEXTURE_2D_ARRAY);

that’s is normal?

Well, you’d expect it to use lower-resolution mipmap levels at small scale factors. The number of mipmap levels should normally be floor(log2(resolution)), i.e. enough to store all levels down to 1x1. Are you doing anything odd in the fragment shader which would affect the level-of-detail calculation?

Also, have you tried both versions without anisotropy?

When I test with 1, 2 or 3 value for the mipMap value, I get this


And seems like the ‘glTexParameteri’ in the texture Array link doesn’t work because that seems exactly if the filters were setting on GL_NEAREST

The texture resolution is no hight, just 512x512, in the fragment shader I am takin a simple texture reading (yes just one line, like that)

fragColor = texture(diffuseMap, vec3(coors.x, coors.y, 0)).rgb;
fragColor = texture(diffuseMap, vec2(coors) ).rgb;

`
When I tested without anisotropy just change a little, and they look a very little more blurred (both)