public static MarvinImage binaryToRgb ( MarvinImage img ) { MarvinImage resultImage = new MarvinImage ( img . getWidth ( ) , img . getHeight ( ) , MarvinImage . COLOR_MODEL_RGB ) ; for ( int y = 0 ; y < img . getHeight ( ) ; y ++ ) { for ( int x = 0 ; x < img . getWidth ( ) ; x ++ ) { if ( img . getBinaryColor ( x , y ) ) { resultImage . setIntColor ( x , y , 0 , 0 , 0 ) ; } else { resultImage . setIntColor ( x , y , 255 , 255 , 255 ) ; } } } return resultImage ; }
Converts an image in BINARY mode to RGB mode