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 »

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: 1570
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 »

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 »

Apologies, I could not get google drive link to work. I edited original post with link to photobucket.
User avatar
dlemstra
Posts: 1570
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 »

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 »

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

Thank you.
Post Reply