Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert buffered image to image and vice-versa?

Tags:

People also ask

How do I change a buffered image to an image?

You can use BufferImage's getScaledInstance() to scale BufferedImage in java. final int SCALE = 2; Image img = new ImageIcon("MyFile. png").

Can ImageIO read JPG?

imageio package. Image I/O has built-in support for GIF, PNG, JPEG, BMP, and WBMP. Image I/O is also extensible so that developers or administrators can "plug-in" support for additional formats. For example, plug-ins for TIFF and JPEG 2000 are separately available.


Actually i am working on a image editing software and now i want to convert the buffered-image i.e :

  BufferedImage buffer = ImageIO.read(new File(file)); 

to Image i.e in the format something like :

  Image image  = ImageIO.read(new File(file)); 

Is it possible to so?? If yes, then how??