code: public void overwriteTRNS(byte r, byte g, byte b) {
          if(hasAlphaChannel()) {
              throw new UnsupportedOperationException("image has an alpha channel");
          }
          byte[] pal = this.palette;
          if(pal == null) {
              transPixel = new byte[] { 0, r, 0, g, 0, b };
          } else {
              paletteA = new byte[pal.length/3];
              for(int i=0,j=0 ; i<pal.length ; i+=3,j++) {
                  if(pal[i] != r || pal[i+1] != g || pal[i+2] != b) {
                      paletteA[j] = (byte)0xFF;
                  }
              }
          }
      }
docs: Overwrites the tRNS chunk entry to make a selected color transparent.
  <p>This can only be invoked when the image has no alpha channel.</p>
  <p>Calling this method causes {@link #hasAlpha()} to return true.</p>
  
  @param r the red component of the color to make transparent
  @param g the green component of the color to make transparent
  @param b the blue component of the color to make transparent
  @throws UnsupportedOperationException if the tRNS chunk data can't be set
  @see #hasAlphaChannel()