PCX to PDF conversion inverts some colors to black

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
jbuzz
Posts: 4
Joined: 2016-01-19T15:51:51-07:00
Authentication code: 1151

PCX to PDF conversion inverts some colors to black

Post by jbuzz » 2016-01-25T15:26:41-07:00

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.
Last edited by jbuzz on 2016-01-26T12:50:12-07:00, edited 9 times in total.

User avatar
dlemstra
Posts: 1562
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: PCX to PDF conversion inverts some colors to black

Post by dlemstra » 2016-01-25T15:35:43-07:00

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.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

jbuzz
Posts: 4
Joined: 2016-01-19T15:51:51-07:00
Authentication code: 1151

Re: PCX to PDF conversion inverts some colors to black

Post by jbuzz » 2016-01-25T15:43:42-07:00

Apologies, I could not get google drive link to work. I edited original post with link to photobucket.

User avatar
dlemstra
Posts: 1562
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: PCX to PDF conversion inverts some colors to black

Post by dlemstra » 2016-01-26T02:10:12-07:00

Could you add a link to your PCX file? This looks like a bug in the PCX reader.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

jbuzz
Posts: 4
Joined: 2016-01-19T15:51:51-07:00
Authentication code: 1151

Re: PCX to PDF conversion inverts some colors to black

Post by jbuzz » 2016-01-26T08:18:35-07:00

Here is a link to the original PCX image https://www.dropbox.com/s/zmb3xehlkze2r ... 6.pcx?dl=0

Thank you.

Post Reply