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

Magick.Net Convert 10bit log dpx file to jpg

Aug 1, 2013 at 2:55 AM
Hi Magick.Net:
Magick.Net to convert 10bit log dpx file ,but is look like black,when set the gamma value 1.7,the black image is good,but some white is bad.I try to used magickImage.AddProfile(ColorProfile.SRGB); but it not work.
try magickImage.ColorSpace = ColorSpace.sRGB; not work.

Dpx for ImageMagick
http://www.imagemagick.org/script/motion-picture.php

This problem is same
http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=19519

Thx Magick.Net Team
Aug 1, 2013 at 6:09 AM
Can you share the image you are using? And a bit of sample code?
Aug 4, 2013 at 3:23 PM
dlemstra wrote:
Can you share the image you are using? And a bit of sample code?

my code

//this using magick.net
 public static FileInfo DPXConvertJPG(String ImagePath)
        {
            //check the dpx file
            //if dpx file used the nconvert to jpg
            //else used the magick.net to convert 

            MagickImage magickImage = new MagickImage(ImagePath);
            //MagickImage magickImage = new MagickImage();
            //magickImage.AddProfile(ColorProfile.SRGB);


            //magickImage.ColorSpace = ColorSpace.sRGB;

            //magickImage.Gamma(1.7);
            //magickImage.Format = MagickFormat.Jpeg;

            FileInfo Jpg = new FileInfo("temp.jpg");

            magickImage.Write(Jpg.FullName);
            return Jpg;
        }

//this function using the xnviewer`s nconvert.exe ,the result is true 
        public static FileInfo ImageConvertJpg(String ImagePath, String JpgPath)
        {
            //check the dpx file
            FileInfo image = new FileInfo(ImagePath);
            if (image.Exists)
            {
                //Get the extension to image
                Console.WriteLine(image.Extension);
                if (image.Extension == ".dpx")
                {
                    Execute execute = new Execute();
                    String command = @"nconvert.exe -o " + JpgPath + " -out jpeg ";
                    command = command + @"""" + ImagePath + @"""";

                    Console.WriteLine("Command : " + command);
                    String Output = execute.run(command);
                    Console.WriteLine(Output);

                    FileInfo Jpg = new FileInfo(JpgPath);
                    return Jpg;
                }
                else
                {
                    //other image file
                    MagickImage magickImage = new MagickImage(ImagePath);
                    FileInfo Jpg = new FileInfo(JpgPath);
                    magickImage.Write(Jpg.FullName);
                    return Jpg;
                }
            }
            else
            {
                return null;
            }
            return null;
        }
THX magick.net

Dpx file can`t send email to magick@discussions.codeplex.com
Aug 7, 2013 at 3:51 PM
I find out that command :
convert.exe -colorspace log test.dpx -set colorspace sRGB test.jpg
Aug 7, 2013 at 4:40 PM
I am getting the correct result with the following code:
using (MagickImage image = new MagickImage("161-020-03_A091.0003894.dpx"))
{
  image.SetAttribute("colorspace", "sRGB");
  image.Write("output.jpg");
}
Aug 8, 2013 at 4:00 AM
dlemstra wrote:
I am getting the correct result with the following code:
using (MagickImage image = new MagickImage("161-020-03_A091.0003894.dpx"))
{
  image.SetAttribute("colorspace", "sRGB");
  image.Write("output.jpg");
}
in Nagick.NET-6.8.6301-Q16-x86-net20 the code is
            MagickImage magickImage = new MagickImage(DpxPath);
            magickImage.Attribute("colorspace", "sRGB");
            magickImage.Write("output.jpg");