Let me explain my issue. I have a service that does some mathematic calculations ( very very difficult ). It is some sort of statistic calculations. This service returns two-dimensional array of booleans ( boolean [][] 400x400). After i am create an image corresponding to this array:
BufferedImage im = new BufferedImage( area.length, area.length, BufferedImage.TYPE_INT_RGB );
Graphics2D g2 = in.createGraphics();
g2.setColor( Color.BLACK);
for ( int i = 0; i < area.length; i++ ) {
for ( int j = 0; j < area.length; j++ ) {
if ( area[ i ][ j ] ) {
g2.fillRect( j, i, 1, 1 );
}
}
}
ImageIO.write( im, someformat, somefile );
The code is pretty simple. And as a result i am create Pic1 ( see attached file ). Yellow border is just for example as well as yellow points ( image pixels ). Also i want to show you some content of boolean array ( it is only example and i will print true as 1 and false as 0 ):
{ 0,.0,............. .... ............0 }
.................... ...
{ 0,0,0,0,0,1,1,.... .... ............0 }
{ 0,0,0,1,1,0,1,.... .... ............0 }
{ 0,0,1,1,0,0,0,1,1, .... ............0 }
{ 0,0,0,1,0,0,0,1,0, .... ............0 }
..................................
{ 0,.0,............. .... ............0 }
So as a result i have as i said Pic1. Yes i know this picture looks very strange. In practice it can be whatever shape but it always will be closed. This image looks very ugly and instead i want to draw it like some curve line with some width and without any roughness. I am tried to show it on Pic2 ( yeah..... it is also ugly.... my drawing is bad ).
My skills and knowledges in image processing is bad and i definetly need help and clarifications. May be it is not possible to achieve my goal using Java at all. I don't know. May be there is some library or something else that can help me.
I will apreciate for any response and help, thanks.