How do I change the compression format of all my texture atlases?

I am trying to change the compression of all my texture atlases to PVRTC_RGBA4 so that I don’t have to do them one by one.
Here is my code:

				if( !file.EndsWith( ".meta" ) )
				{
					string path = "Assets/Resources/Bundles/" + Path.GetFileName(bundle) + "/Atlases/" + Path.GetFileName(file);
					tex2D = (Texture2D)Resources.LoadAssetAtPath( path, typeof(Texture2D) );
					PostprocessTexture( tex2D );
				}

I get no errors and it pops out what I expect from the last Debug.Log, but it doesn’t actually seem to do the compression when I look at the atlas in the inspector. I have also tried using AssetDatabase instead of Resources but that didn’t seem to do much of anything.

What am I doing wrong? Or what am I missing?

I figured out my own question. I should have been reimporting the image instead of trying to change the compression on the file. Here is my updated code:

				if( file.EndsWith( ".png" ) || file.EndsWith( ".tga" ) )
				{
					string path = "Assets/Resources/Bundles/" + Path.GetFileName(bundle) + "/Atlases/" + Path.GetFileName(file);
					tex2D = (Texture2D)AssetDatabase.LoadAssetAtPath( path, typeof(Texture2D) );
					TextureImporter importer = ( TextureImporter ) TextureImporter.GetAtPath ( path );
					importer.textureType 	= TextureImporterType.Advanced;
					importer.npotScale 		= TextureImporterNPOTScale.None;
					importer.textureFormat 	= TextureImporterFormat.PVRTC_RGBA4;
					importer.wrapMode		= TextureWrapMode.Clamp;
					importer.isReadable 	= true;
					importer.mipmapEnabled 	= false;
					importer.maxTextureSize = 4096;
					
					AssetDatabase.ImportAsset( path );
				}

This is no longer valid form of update. Most of the properties are obsolete.