Page 1 of 1

PCX to PDF conversion inverts some colors to black

Posted: 2016-01-25T15:26:41-07:00
by jbuzz
I am trying to convert a PCX image to PDF. The colors are sort of inverted. I says "sort of" because I tried purposely inverting the colors using Negate() and the output was different.

Here is a screenshot of what I am seeing with native PCX image on left and ImageMagick PDF on the right:

Image

My code is very, very simple:

Code: Select all

                using (MagickImageCollection imgcoll = new MagickImageCollection(inpath))
                {
                    using (MagickImageCollection pdfcoll = new MagickImageCollection())
                    {
                        foreach (MagickImage img in imgcoll)
                        {
                            pdfcoll.Add(img);
                        }
                        if (!Directory.Exists(new FileInfo(outpath).DirectoryName))
                        { Directory.CreateDirectory(new FileInfo(outpath).DirectoryName); }
                        pdfcoll.Write(outpath);
                    }
                }
Any ideas why the colors are being swapped / inverted?

Thank you.

Re: PCX to PDF conversion inverts some colors to black

Posted: 2016-01-25T15:35:43-07:00
by dlemstra
Your screenshot is not visible could you add a link to your PCX file and your screenshot? You could use something like DropBox for that.

Re: PCX to PDF conversion inverts some colors to black

Posted: 2016-01-25T15:43:42-07:00
by jbuzz
Apologies, I could not get google drive link to work. I edited original post with link to photobucket.

Re: PCX to PDF conversion inverts some colors to black

Posted: 2016-01-26T02:10:12-07:00
by dlemstra
Could you add a link to your PCX file? This looks like a bug in the PCX reader.

Re: PCX to PDF conversion inverts some colors to black

Posted: 2016-01-26T08:18:35-07:00
by jbuzz
Here is a link to the original PCX image https://www.dropbox.com/s/zmb3xehlkze2r ... 6.pcx?dl=0

Thank you.