[prev in list] [next in list] [prev in thread] [next in thread] 

List:       imagemagick-developer
Subject:    [magick-developers] jpeg.c and sampling factor's
From:       "Pablo Calamera" <calamera () spies ! com>
Date:       2003-01-30 0:58:42
[Download RAW message or body]

I have included a patch to the jpeg.c coder which allows you to specify
more elaborate sampling factors (e.g. "2.0x1.0,1.0x1.0").  This produces
very favorable size/quality tradeoffs in the resulting jpeg image.

If possible it would be great to see this (or similar) rolled into a
future IM.

Cheers,
Pablo



["ImageMagick-5.5.4.jpeg.c.patch" (application/octet-stream)]

1531c1531
<     {
---
>   {
1538a1539,1540
>       char* sampling = image_info->sampling_factor;
> 
1542,1545d1543
<       count=sscanf(image_info->sampling_factor,"%lfx%lf",&horizontal_factor,
<         &vertical_factor);
<       if (count != 2)
<         vertical_factor=horizontal_factor;
1548,1551c1546,1558
<         jpeg_info.comp_info[i].h_samp_factor=(int) horizontal_factor;
<         jpeg_info.comp_info[i].v_samp_factor=(int) vertical_factor;
<       }
<     }
---
>         if (*sampling) /* if we have added sampling factors */
>         {
>               count=sscanf(sampling,"%lfx%lf",&horizontal_factor,
>                   &vertical_factor);
>               if (count != 2)
>                 vertical_factor=horizontal_factor;
>         }
>         jpeg_info.comp_info[i].h_samp_factor=horizontal_factor;
>         jpeg_info.comp_info[i].v_samp_factor=vertical_factor;
> 
>        while (*sampling && *sampling++ != ','); /* advance to other factors */
>      }
>    }


_______________________________________________
Magick-developers mailing list
Magick-developers@imagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick-developers


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic