title: Changing the compression format of multiple textures
body: <p>I'm using the following method to compress a bunch of textures:</p>
  
  <pre><code>public void OnPostprocessTexture (Texture2D t) {
          EditorUtility.CompressTexture(t, TextureFormat.DXT5, 2); 
  } 
  </code></pre>
  
  <p>The idea is to try to compress the texture when importing it. I have a project with many textures which are not using an optimal format.</p>
  
  <p>The problem is that these changes are not saved anywhere, if you check the editor you'll see that the format remains the same. I can leave the script there and reimport everything in the build server, but I'd like a way to save these changes.</p>
  
  <p>The only way I can think of this is to create another texture using the format I want and copying/replace the texture. Is there a better way to do this?</p>
  
  <hr>
  
  <p><strong>Edit</strong></p>
  
  <p>Doing some more tests, I noticed something strange: <code>EditorUtility.CompressTexture</code> is somehow compressing NPOT textures. This is before running the script:</p>
  
  <p><img src="https://i.stack.imgur.com/4Oy1E.png" alt="before"></p>
  
  <p>And this is after running <code>EditorUtility.CompressTexture</code>:</p>
  
  <p><img src="https://i.stack.imgur.com/WllZF.png" alt="after"></p>
  
  <p>How does this work?
  While Sergey's answer helps me change the format, it won't compress NPOT textures and I really need to save these bytes.</p>