title: Cant use setRGB() to write to png
body: <pre><code>public static void main(String[] args) {
      String finalHex = "";
      String input = "Hello There Sir.";
      int pixelX = -1;
      int pixelY = 0;
      try{
          BufferedImage bi = new BufferedImage(64, 64, BufferedImage.TYPE_INT_ARGB);
          File out = new File("saved.png");
          if(out.exists()==false){
              ImageIO.write(bi, "png", out);
              System.out.println("PNG WAS CREATED");
          }else 
              System.out.println("ERROR: PNG WAS ALREADY THERE");
          for (int i = 0;i &lt; input.length(); i++){
              char result = input.charAt(i);
              int ascii = (int) result;
              String num = Integer.toHexString(ascii).toUpperCase();
              if(finalHex.length()==6){
                  System.out.println(finalHex);
                  pixelX += 1;
                  finalHex=("#"+finalHex);        
                  Color c = Color.decode(finalHex);
                  int rgb = c.getRGB();
                  System.out.println(rgb);
                  if(pixelX==63){
                      pixelX=0;
                      pixelY+=1;
                  }
                  bi.setRGB(pixelX, pixelY, rgb);                 
                  finalHex="";                    
              }
              finalHex+=num;              
          }           
      }catch(IOException e){
          System.out.println("ERROR: WELP... SOMETHING SCREWED UP.");
      }
  }
  </code></pre>
  
  <p>I am trying to use this to convert text into a png image but I cant get it to write to a png file. I am not that experienced in this area so if anyone could help me out i would be very much appreciated. :)</p>