Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bitmap to JPEG Conversion 1

Status
Not open for further replies.

aarushi2001

Technical User
Nov 16, 2005
109
0
0
US
Hi Guys,

I need some guidance. I need to write a code/program which can convert a bitmap image to JPEG format and store the image at new location (whatever designated place).

Any articles/snippets which can help me get started. Or any APIs etc I need to install to get started.

Thanks,
 
Maybe the JAI can do it. Java Advanced Imaging library. Available on the Sun site.

Tim
 
I'm a novice at Java, but here's what I found.


Code:
// Load the input image.
String inputFile = "image.bmp";
RenderedOp src = JAI.create("fileload", inputFile);

// Store it as a JPEG
String outputFile = "image.jpg";
JAI.create("filestore", src, outputFile, "jpeg",
           (ImageEncodeParam)null);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top