Re: BufferedImage & pixels.

From: aaaaaaaaaaaa (aaaaaaaaaaaa_at_wp.pl_invalid)
Date: 01/17/04


Date: Sat, 17 Jan 2004 18:13:15 +0100

w <news:MPG.1a72fa12589aec0b9898b1@news.pop4.net>
Chris Smith wrote:
 
> My guess is that your "Y" array contains an image with bad
> contrast.

Try again :)
Below code makes ".raw" file, which looks great...

byte[] r = new byte[imageWidth * imageHeight];
int k = 0;

for (int i = 0; i < imageHeight; i++)
  for (int j = 0; j < imageWidth; j++) {
    r[k] = (byte) Y[j][i];
    k++;
  }

try {
  out.write(r);
} catch (IOException e) {
  e.printStackTrace();
}

Any other ideas, how to create b&w BufferedImage?



Relevant Pages

  • Re: Random Access File IO
    ... int iRecordNumber; ... HOW DO I CREATE A SIMPLE PROGRAM TO DO RANDOM ACCESS FILE I/O? ... public static int getRecordCountthrows IOException{ ... public static Book readRecord(int recordNumber) throws IOException{ ...
    (comp.lang.java.help)
  • Java/OO techniques for modularity and re-use
    ... Tier3Socket (String host, int port, int maxBufSiz, String hostCharSet) ... IOException ... public void handShakethrows IOException ...
    (comp.lang.java.programmer)
  • javax.net.ssl Sockets and OKing self-signed certificates
    ... Tier3Socket (String host, int port, int maxBufSiz, String hostCharSet, ... IOException ... public void handShakethrows IOException ...
    (comp.lang.javascript)
  • javax.net.ssl Sockets and OKing self-signed certificates
    ... Tier3Socket (String host, int port, int maxBufSiz, String hostCharSet, ... IOException ... public void handShakethrows IOException ...
    (comp.lang.java.programmer)
  • Re: Technique suggestions
    ... the cameras themselves are totally dumb regarding RAW ... the blue sky is only a small portion of the image, ... Conversion with normal saturation and color tone settings can ... ago had a red flower blowing out in the JPEG (with -2 contrast setting, ...
    (rec.photo.digital.slr-systems)