Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the practical differences between imagick::INTERLACE_JPEG/INTERLACE_PLANE/INTERLACE_LINE?

There's many "interlace" options in ImageMagick, but I don't really understand the difference. All of the options in the title appear to generate a comparable JPG file - maybe if I had a slower/throttled connection I could discern a difference.

Is there any practical difference? Should one be chosen over the other?

Thanks

like image 479
Codemonkey Avatar asked Apr 05 '16 11:04

Codemonkey


1 Answers

There's no difference. Here is the relevant code in ImageMagick's jpeg encoder:

#if (JPEG_LIB_VERSION >= 61) && defined(C_PROGRESSIVE_SUPPORTED)
  if ((LocaleCompare(image_info->magick,"PJPEG") == 0) ||
      (image_info->interlace != NoInterlace))
    {
      if (image->debug != MagickFalse)
        (void) LogMagickEvent(CoderEvent,GetMagickModule(),
          "Interlace: progressive");
      jpeg_simple_progression(&jpeg_info);
    }
  else
    if (image->debug != MagickFalse)
      (void) LogMagickEvent(CoderEvent,GetMagickModule(),
        "Interlace: non-progressive");
#else
  if (image->debug != MagickFalse)
    (void) LogMagickEvent(CoderEvent,GetMagickModule(),
      "Interlace: nonprogressive");
#endif

That is, if progressive JPEG is supported and interlace is not NoInterlace, it'll write a progressive JPEG, no matter what flavor of interlacing you request. As you can see in the second line of the quoted code, you can also request progressive output by using the "PJPEG" extension or "PJPEG" format.

like image 119
Glenn Randers-Pehrson Avatar answered Nov 09 '22 11:11

Glenn Randers-Pehrson