This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, December 28, 2006 7:57:33 PM(UTC)
Groups: Registered
Posts: 9
Hi There
I am Hemant here,
I am using Lead Raster Viewer control in my project.
I am selecting images from the files(These are originally scanned and stored as JPEG image Files)
When I save it back after croping and changing other image properties, instead of reducing the size it increases the size.
I want to save these Images as JPEG Images only. Is there any method of reducing the size of the images before you save it?
I am using following code to save the image from Raster View Control.
RasterIO.save(LeadRasterView1.Raster,"C:\\xyz.jpg",LTRASTERIOLib.RasterFileConstants.FILE_EXIF_JPEG_411,
LTRASTERIOLib.QFactorConstants.QFACTOR_ABCQ_LOSSY_FAST,0);
This statement is saving the image as jpg image but the size of the saved image is more than the
original.
So please help us to reduce the size of the file.
With Regards
Hemant BK
#2
Posted
:
Thursday, January 4, 2007 5:42:26 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
1) Make sure you save the file at the same bits per pixel as the original file. You can do this by passing a '0' for the BitsPerPixel paramater.
2) Try changing the Q factor to a higher number. Valid values are from 2-255 with 2 being the largest size/best quality and 255 being the smallest size/lowest quality. You will need to experiment with different values to see which one provides you the desired results.
3) Unless the original file is an EXIF JPEG, you do not need to save it as an EXIF JPEG. You can try other formats such as FILE_JPEG_LAB_411, FILE_JPEG_LAB_422, FILE_JPEG_RGB, etc. All of the supported formats are listed in the help file. You can check the exact original format by calling the GetFileInfo method on the original file then checking the InfoFormat property. More information and sample code can be found in the COM object help file.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.