code: public static int[] renderedImage2IntegerArray( RenderedImage renderedImage, double multiply ) {
          int width = renderedImage.getWidth();
          int height = renderedImage.getHeight();
  
          int[] values = new int[width * height];
          RandomIter imageIter = RandomIterFactory.create(renderedImage, null);
          int index = 0;;
          for( int x = 0; x < width; x++ ) {
              for( int y = 0; y < height; y++ ) {
                  double sample = imageIter.getSampleDouble(x, y, 0);
                  sample = sample * multiply;
                  values[index++] = (int) sample;
              }
          }
          imageIter.done();
          return values;
      }
docs: Transform a double values rendered image in its integer array representation by scaling the values.
  
  @param renderedImage the rendered image to transform.
  @param multiply value by which to multiply the values before casting to integer.
  @return the array holding the data.