Possible bug when defining a new ColorSpace

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
pablobhz
Posts: 69
Joined: 2016-05-07T06:47:14-07:00
Authentication code: 1151

Possible bug when defining a new ColorSpace

Post by pablobhz »

Hello everyone. I've noted this today.
When you set the ColorSpace to CMYK, you expect the channels to be "Cyan, Magenta, Yellow, Black".

However, it isn't being that way. I attached an screenshot, where channels can be clearly see as "Cyan , Green , Blue, Black".
Even when i set the ColorSpace to sRGB , the channels available are "Cyan, Green, Blue".

Image
On the screenshot above, i defined the ColorSpace as CMYK
Edit
Version: MagickNET-Q16-x64 v7.0.5.501
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Possible bug when defining a new ColorSpace

Post by fmw42 »

Use -colorspace CMYK not -set colorspace CMYK . But to be sure we understand what you are trying to do, please provide your command line.

I have moved this post to the Magick.Net forum since it is most likely an issue of command syntax.
pablobhz
Posts: 69
Joined: 2016-05-07T06:47:14-07:00
Authentication code: 1151

Re: Possible bug when defining a new ColorSpace

Post by pablobhz »

The syntax is correct.

Code: Select all

using (MagickImage testImage = new MagickImage(@"C:\inputfolder\testimage.png"))
            {
                testImage.ColorSpace = ColorSpace.CMYK;
            }
I'm not using the command line interface, i'm using the .NET Wrapper.

After set the ColorSpace to CMYK, when i try to access the channels they aren't being set plus appear like "Cyan , Green , Blue, Black"(instead of the CMYK).
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Possible bug when defining a new ColorSpace

Post by snibgo »

Where has that screenshot come from? Perhaps that program is the one that has a bug.
snibgo's IM pages: im.snibgo.com
pablobhz
Posts: 69
Joined: 2016-05-07T06:47:14-07:00
Authentication code: 1151

Re: Possible bug when defining a new ColorSpace

Post by pablobhz »

The screenshot came from Visual Studio 2015 (Community Edition, Free)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Possible bug when defining a new ColorSpace

Post by snibgo »

As far as I know, IM doesn't write channel names "red", "cyan" etc into files. It writes colorspaces (sRGB, Lab, CMYK etc) into files, and programs such as IM's "identify" then expand these into channel names.

I suggest you try identify and exiftool on your file. You might also try a binary search in the file for those strings.
snibgo's IM pages: im.snibgo.com
pablobhz
Posts: 69
Joined: 2016-05-07T06:47:14-07:00
Authentication code: 1151

Re: Possible bug when defining a new ColorSpace

Post by pablobhz »

Let me see if i got it correctly.

My goal: After set the image ColorSpace to CMYK , set the channels individually on the image. IM won't do that ?
Ex:
1 - Set the image colorspace to CMYK
2 - On some pixels , i want C(0), M(0.3), Y(0.1), K(0)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Possible bug when defining a new ColorSpace

Post by fmw42 »

I would suggest you change the pixel values in the individual grayscale images first, then combine into CMYK colorspace.
pablobhz
Posts: 69
Joined: 2016-05-07T06:47:14-07:00
Authentication code: 1151

Re: Possible bug when defining a new ColorSpace

Post by pablobhz »

A grayscale image has only one channel. I need to change the values on a rGB scale or CMYK scale.
I got an method that uses unsafe code (pointers to the memory) for doing that ; however, it's still slow for doing all the stuff. I think MagickNET can be faster.

Should i delete this topic, since it isn't about an bug or something ?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Possible bug when defining a new ColorSpace

Post by snibgo »

Don't delete it.

If you have a usage question, please start a new thread.
snibgo's IM pages: im.snibgo.com
Post Reply