Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Magick.Net Convert 10bit log dpx file to jpg

$
0
0
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

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>