-
August 18th, 2011, 12:34 AM
#1
Convert BMP to JPG using Java
HI,
I am trying to convert an image in BMP format to JPG format. In the course of conversion, the DPI of the image is lost (default DPI is getting applied after conversion).
For example, If the DPI of original image (BMP format) is 300 DPI, on converting DPI of JPG is getting changed to default system DPI (i.e., 96 DPI).
I tried converting the image using JAI and JPEG Encode, but got the same result.
Can anyone please let me know how to convert an image from BMP format to JPG format without compromising on DPI. It is a bit URGENT.
Sorry if there is any post relating to same earlier (which i may have skipped).
Thanks
-
August 18th, 2011, 11:30 PM
#2
Re: Convert BMP to JPG using Java
if you want to do in manually and lets say on windows , then you need to read in the BMP file , in a uncompressed BMP the image data is stored as BGR as oppose RBG , each with 1 unsigned char ( 1 byte ) range from 0 to 255 per channel.
you can use
http://www.jmagick.org/index.html;js...7E995E3621DA97
to extract the image data and then recode to JPEG just the same,
-
August 19th, 2011, 12:54 PM
#3
Re: Convert BMP to JPG using Java
on converting DPI of JPG is getting changed to default system DPI (i.e., 96 DPI).
How are you creating and writing the jpg file. Are there options to control the quality of the output image?
Norm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|