public void drawRedderImage(Graphics2D g2d, BufferedImage im,
            int x, int y, float brightness)
            // using LookupOp
  /* Draw the image with its redness is increased, and its greenness
     and blueness decreased. Any alpha channel is left unchanged.
   */
    { if (im == null) {
          System.out.println("drawRedderImage: input image is null");
          return;
      }
      
      if (brightness < 0.0f) {
          System.out.println("Brightness must be >= 0.0f; setting to 0.0f");
          brightness = 0.0f;
      }
      // brightness may be less than 1.0 to make the image less red
      
      short[] brighten = new short[256];    // for red channel
      short[] lessen = new short[256];      // for green and blue channels
      short[] noChange = new short[256];    // for the alpha channel
      
      for(int i=0; i < 256; i++) {
          float brightVal = 64.0f + (brightness * i);
          if (brightVal > 255.0f)
              brightVal = 255.0f;
          brighten[i] = (short) brightVal;
          lessen[i] = (short) ((float)i / brightness);
          noChange[i] = (short) i;
      }
      
      short[][] brightenRed;
      if (hasAlpha(im)) {
          brightenRed = new short[4][];
          brightenRed[0] = brighten;
          brightenRed[1] = lessen;
          brightenRed[2] = lessen;
          brightenRed[3] = noChange;    // without this the LookupOp fails
          // which is a bug (?)
      } else {  // not transparent
          brightenRed = new short[3][];
          brightenRed[0] = brighten;
          brightenRed[1] = lessen;
          brightenRed[2] = lessen;
      }
      LookupTable table = new ShortLookupTable(0, brightenRed);
      LookupOp brightenRedOp = new LookupOp(table, null);
      
      g2d.drawImage(im, brightenRedOp, x, y);
    }  // end of drawRedderImage() using LookupOp