Switch to full style
General Java code examples
Post a reply

Image I/O library

Tue Nov 11, 2008 8:21 pm

use Image I/O library of java
Code:
import java.io.*;
import java.awt.image.*;
import javax.imageio.ImageIO;

public class 
CopyImage {
    private static final 
float[] data = { 0.0f, -1.0f0.0f, -1.0f5.0f,
      -
1.0f0.0f, -1.0f0.0f };
    public static 
void main(String args[]) throws IOException {
    
File fileIn = new File("image4.jpg");
    
BufferedImage bufferedImage1 ImageIO.read(fileIn);
    
Kernel kernel = new Kernel(33data);
    
ConvolveOp convolveOp = new ConvolveOp(kernelConvolveOp.EDGE_NO_OP,
        
null);
    
int width bufferedImage1.getWidth();
    
int height bufferedImage1.getHeight();
    
BufferedImage bufferedImage2 = new BufferedImage(widthheight,
        
BufferedImage.TYPE_INT_ARGB);
    
convolveOp.filter(bufferedImage1bufferedImage2);
    
File fileOut = new File("logo.gif");
    
ImageIO.write(bufferedImage2"GIF"fileOut);
  }




Post a reply
  Related Posts  to : Image I/O library
 Library Sort     -  
 Math Function Library     -  
 PHP SOAP server returns array using NuSOAP Library     -  
 Java Library Database Management System Project     -  
 PHP SOAP server returns array using NuSOAP Library     -  
 simple Ajax library solving back button and bookmarks     -  
 Image-Viewer-Image Processing-Filters-Noise-enhancements     -  
 Move image in front of a background image     -  
 different between cfa image and gray level image     -  
 PNG image to the image you generated     -  

Topic Tags

Java Image