Question

I want to create a PNG file from a System.Drawing.Bitmap with the colours defined using CMYK.

I can create the PNG OK but how do I define 'with CMYK' ?

I've looked at the encoderparameters argument to the save method but it seems to me they don't cover what I need ?

Any pointers/samples appreciated.

thanks

Was it helpful?

Solution

The PNG format was designed for transferring graphics for display on computer screens. PNG files may only transfer grayscale or RGB/RGBA image data; you can't have a CMYK PNG file: http://www.w3.org/TR/2003/REC-PNG-20031110/#11IHDR

OTHER TIPS

        .
        .
        .
        MemoryStream ms=new MemoryStream();
        ImageCodecInfo imageCodecInfo = ImageCodecInfo.GetImageDecoders()[0];
        EncoderParameters encoderParameters=new EncoderParameters(1);
        encoderParameters.Param[0] = new EncoderParameter(Encoder.Compression,(int)EncoderValue.);
        bmp.Save(ms,imageCodecInfo, encoderParameters);
        Bitmap newbmp = (Bitmap) Image.FromStream(ms);
        .
        .
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top