Re: Trouble with using MagickGetSamplingFactors API

"mler" <[email protected]> Fri, 5 Jul 2013 12:59:59 +0800
Newsgroups gmane.comp.video.graphicsmagick.apis
Message-ID <[email protected]>
Hi, Bob:
        Very grateful for your answer, but I still have a little doubt.  I use  the API: 

        MagickSetImageOption(wand,'jpeg','preserve-settings','true');

that you suggest,  but I find  that  the size of the output  image  is larger than the size of the original image.  For instance,  the original image(20KB), after stripping,  the output image(30KB).

I have tried a lot of ways to make the size of the  image much smaller  while maintaining visibility  , but I always can not obtain satisfactory results . Sometimes  the size of the output image is larger than the  the original image,  sometimes the output image is not very sharp . Any sugesst  for me?   Thank you so much again.   



------------------ Original ------------------
From:  "Bob Friesenhahn"<[email protected]>;
Date:  Thu, Jul 4, 2013 11:29 PM
To:  "mler"<[email protected]>; 
Cc:  "graphicsmagick-apis"<[email protected]>; 
Subject:  Re: [GM-apis] Trouble with using MagickGetSamplingFactors API



On Thu, 4 Jul 2013, google wrote:

> Hi Bob:
>       I am so Sorry , I didn't describe my ploblem exactly.  I just want to strip the input image ,
> and not to change the sampling factor and quality of the input image.

GM's normal operation is to decompress the image into memory and then 
recompress to the output image from memory.  This means that it is 
doing quite a lot more than just stripping attached profiles.

I think that if you use:

   MagickSetImageOption(wand,'jpeg','preserve-settings','true');

that GM should then apply the same settings that it deduced when the 
image file was read and so the output image may be virtually the same. 
If you attempt to change any of the settings (e.g. quality, sampling, 
colorspace), then this request will likely be ignored and it will use 
your new settings.  Someday this behavior may become the default.

However, there are multiple independently authored JPEG writers in the 
world and a JPEG written by Photoshop may not be identical to one 
written using the IJG JPEG library (as GM uses) because there is no 
standard for the encoding factors used. The original JPEG parameters 
are only estimated and are most accurate for JPEG written by IJG JPEG 
(which uses quality factor 0-100).

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

_______________________________________________
Graphicsmagick-apis mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-apis