2014-04-01 32 views
0

我有一个图像的每个像素的RGB值。现在我想用这些值重建图像。我如何使用java实现它?使用RGB值构建图像

+0

您利用图形库。如果你问哪个图形库应该使用,这将成为基于意见。 –

+0

[从rgb像素值创建缓冲图像]的可能重复(http://stackoverflow.com/questions/4617845/create-a-buffered-image-from-rgb-pixel-values) – Sorter

+0

[int array到BufferedImage](http://stackoverflow.com/questions/14416107/int-array-to-bufferedimage) – haraldK

回答

0

有几乎远远超过这一说...

BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); 
for (int x=0; x<w; x++) 
{ 
    for(int y=0; y<h; y++) 
    { 
     image.setRGB(x,y,rgbValueFor(x,y)); 
    } 
} 

...那你似乎并没有把在网上搜索,或使...