This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, November 1, 2006 1:17:22 AM(UTC)
Groups: Registered
Posts: 3
This is a part of Code for saving Image file (JPEG)
----------------------------------------------------------------------------------------------------------------
LUserAnimationWindow m_LAniWnd;
...
m_LAniWnd.SetFileName(_T("c:\\test.jpg");
...
m_LAniWnd.Load( m_LAniWnd.fInfo.BitsPerPixel,
ORDER_BGRORGRAY,
&LoadFileOption,
&m_LAniWnd.fInfo);
...
LBitmap UserBitmap = (LBitmap)m_LAniWnd;
UserBitmap.Save(_T("c:\\image.jpg")
, m_LAniWnd.fInfo.Format // FILE_JPEG
, 24
, m_LAniWnd.fInfo.Format // FILE_JPEG
, NULL
, NULL);
----------------------------------------------------------------------------------------------------------------
But, 'image.jpg' file is low quality and this is small file size more than Original Image.
How to make 'Lossless compression'.
I am waiting for you hands.
#2
Posted
:
Wednesday, November 1, 2006 12:19:56 PM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 764
The quality is probably bad because you are passing in the value of the file format for the QFactor parameter. Most likely, this is a fairly large number. For lossless JPEG I believe you will need to use a value of 0 or 1. Please refer to your Class Library Help file and look for the article "Compression Quality Factors".
#3
Posted
:
Wednesday, November 1, 2006 3:26:54 PM(UTC)
Groups: Registered
Posts: 3
ABCQ_LOSSLESS(0) & ABCQ_VIRTUALLOSSLESS(1)
When I used That QFactor in my Code, Return value is -21.
-21 mean is 'Invalid QFactor specified'.
So, I used QFactor under ABCQ_REMOVEBORDER(2)
From 2 untill 11.
When I used 'ABCQ_REMOVEBORDER(2)', quality of Image is very nice~~!
However, Why don't you support a QFactor 'ABCQ_LOSSLESS(0) & ABCQ_VIRTUALLOSSLESS(1)'
#4
Posted
:
Thursday, November 2, 2006 4:05:58 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 764
It could be that the constants you are using are not the expected values. Try hard-coding the correct values rather than using defined constants or other variables. I used this code to save a lossless JPEG:
m_Wnd.Save(TEXT("c:\\testOut.jpg"), 10, 24, 0, 1, 0);
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.