Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, November 1, 2006 1:17:22 AM(UTC)

yeosang  
yeosang

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.

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, November 1, 2006 12:19:56 PM(UTC)

GregR  
GregR

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)

yeosang  
yeosang

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)

GregR  
GregR

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.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.116 seconds.