Image can be compressed to required size using java AWT and that enables us GUI. The different image files are supported to compress.
Image compressor using Java AWT is a java based API that enables us to compress the images to our required size and dimensions. Java AWT(Abstract Window Toolkit) is a collection of classes and tools and it is a Java package. It is used to build graphical user interfaces (GUIs).
The interface designed using java AWT is user friendly and it can easily resize the images from user's system itself. The user interface elements can be made using AWT components like sliders, buttons, and text fields.
The compressed image can be saved to the user's preferred place after the compression process is finished, with the option to overwrite the original file or save it as a new file.
Here is a snap of input image properties provided to the code of packet.
Here is a snap of output image properties provided to the code of packet.
we can observe here the image size is decreased from 117kb to 16.6kb.
Here is a snap of execution of source code.
code executed succesfully and the compressed image is saved in the system at specified location.
Submitted by Nandishwar Ragula (NandishwarRagula)
Download packets of source code on Coders Packet
Comments