This project has moved and is read-only. For the latest updates, please go here.

didn't find how to set progressive jpeg or interleace

Jul 22, 2013 at 2:30 PM
Edited Jul 22, 2013 at 2:42 PM
this .NET project is a wonderful job. It make image handling with magick a lot easier in NET environments.
I will appreciate if someone could help to find the right way to save the magickImage object as progressive jpeg (and optionally specify the jpeg sampling method)

(my magickImage object was created with "new MagickImage(color, width,height)" and has been modified with writablePixels, now just need to save it as progressive jpeg with specific quality and optionally different subsampling.)

Try several methods, attributes,, formats, options, properties without success.
Hope you can help.
Thank you in advance.

dll version: Magick.NET-
Jul 22, 2013 at 5:56 PM
You can write an progressive image like this:
using (MagickImage image = new MagickImage("input.png"))
  // Set the format and write to a stream so ImageMagick won't detect the file type.
  image.Format = MagickFormat.Pjpeg;
  using (FileStream fs = new FileStream("output.jpg", FileMode.Create))
  // Write to .jpg file
  // Or to a .pjpeg file
At this moment you are unable to set the the jpeg specific options. I will create a workitem to resolve this. Do you want to change the jpeg sampling factor ( or something else?
Jul 22, 2013 at 5:57 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Jul 22, 2013 at 6:32 PM
it works !! (just save the file with pjpg extension)
Your perfect and quick answer probe that you are working on this project seriously.

Thank you very much.

Regarding the subsampling option, you are pointing to the right direction. (sampling-factor)

I was using image and pixel manipulation with the native .net tools for years with success.
The fundamental reason to start using imageMagic and your excellent .Net wrapper is the progressive and subsampling definitions (you can read, but you can't save an image with standard .NET framework with the progressive jpeg feature)

Thank you one more time for all your help. You are doing an excellent job.

I will follow the discussion of the sampling-factor.
Jul 22, 2013 at 8:44 PM
With the next release (will be published in a couple of weeks) you will be able to do this:
image.SetOption(MagickFormat.Jpeg, "sampling-factor", "4x1,2x1,2x1");
Jul 22, 2013 at 9:21 PM
It will be wonderful. developers will appreciate that.
Thank you.
Happy to include credits in the final product.