Codemonkey
Codemonkey

Reputation: 4809

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

Upvotes: 8

Views: 2330

Answers (1)

Glenn Randers-Pehrson
Glenn Randers-Pehrson

Reputation: 12465

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.

Upvotes: 10

Related Questions