You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Read first frame of gif imageusingvarimage=newMagickImage(SampleFiles.SnakewareGif);// Save frame as jpgimage.Write(SampleFiles.OutputDirectory+"Snakeware.jpg");varsettings=newMagickReadSettings();// Tells the xc: reader the image to create should be 800x600settings.Width=800;settings.Height=600;usingvarmemStream=newMemoryStream();// Create image that is completely purple and 800x600usingvarpurple=newMagickImage("xc:purple",settings);// Sets the output format to pngpurple.Format=MagickFormat.Png;// Write the image to the memorystreampurple.Write(memStream);// Read image from fileusingvarsnakeware=newMagickImage(SampleFiles.SnakewarePng);// Sets the output format to jpegsnakeware.Format=MagickFormat.Jpeg;// Create byte array that contains a jpeg filevardata=snakeware.ToByteArray();
Convert CMYK to RGB
// Uses sRGB.icm, eps/pdf produce better result when you set this before loading.varsettings=newMagickReadSettings{ColorSpace=ColorSpace.sRGB};// Create empty imageusingvareps=newMagickImage();// Reads the eps image, the specified settings tell Ghostscript to create an sRGB imageeps.Read(SampleFiles.SnakewareEps,settings);// Save image as tiffeps.Write("Snakeware.tiff");// Read image from fileusingvarpng=newMagickImage(SampleFiles.SnakewareJpg);// Will use the CMYK profile if the image does not contain a color profile.// The second profile will transform the colorspace from CMYK to RGBpng.TransformColorSpace(ColorProfile.USWebCoatedSWOP,ColorProfile.SRGB);// Save image as pngpng.Write("Snakeware.png");// Read image from fileusingvartiff=newMagickImage(SampleFiles.SnakewareJpg);// Will use the CMYK profile if your image does not contain a color profile.// The second profile will transform the colorspace from your custom icc profiletiff.TransformColorSpace(ColorProfile.USWebCoatedSWOP,newColorProfile(SampleFiles.YourProfileIcc));// Save image as tifftiff.Write("Snakeware.tiff");