Unsupported Color Mode: 4 Component Color Mode found

Mar 26, 2011 at 2:01 PM

Hi,

I'm using image tools in a simple silverlight application to load and edit images. However, I have several images where the loading fails with this exception: "Unsupported Color Mode: 4 Component Color Mode found"

So it obviously seems the image has an unsupported color mode. Are there any plans to support such images? Is there some other library that can convert the color mode?

Regards,

max

Coordinator
Mar 26, 2011 at 2:06 PM
Yes, Image Tools does not support all different color modes. What kind
of image is it? JPEG, PNG, GIF?
Mar 26, 2011 at 5:09 PM

Its a JPEG file. Gimp tells me the color profile is sRGB.

Mar 26, 2011 at 5:11 PM
maxpg wrote:

Its a JPEG file. Gimp tells me the color profile is sRGB.

But I'm not sure if Gimp converted the file, it might also be a CMYK file. Do you know a good tool that gives me more details?

Mar 26, 2011 at 8:18 PM

I would have two more questions.

- Is there a plan to include other resizing algorithms (bilinear, bicubic)

- I checked out the source code and tried some experimental changes. However I have a problem that when I add a new class (or delete one) and build the resulting .dll is rebuild but doesn't reflect my changes. Is there anything I have to take care about?

Coordinator
Mar 28, 2011 at 2:27 PM
There are a lot of plans but my time is limited. Feel free to implement
it ;)
Apr 1, 2011 at 7:18 PM

Hi again. I just developed a resizing algorithm (I think its a bilinear resizing as I have the basic idea how to do it from a document discussing bilinear resizing but didn't read the document to the end after I got the basic idea). The resulting images I tested it with are much better as with the NearestNeighbor, at least for a few sample images I tested it with.

Is there a possibility to contribute my code to the project? If so what are the requirements, I didn't contribute to an open source project until now? I've created the written code myself, its based on your NearestNeighborResizer. Can there be any legal problems? As said the code is from me but the general idea of a bilinear filter is of course general knowledge (at least I think so).

What would be the requirements on code quality? There are no unit test in the project, or did I just miss them?

I could probably also help with the missing color mode support I would need. However, could you give me some starting point (documents you where using, other projects,...)?

Coordinator
Apr 6, 2011 at 9:07 PM
Hi maxpg,

I just add you as developer than you have the rights to modify the
source code and commit it. If you need more help for this I think we can
setup a skype session this weekend and I can give you a short discussion.

About code conventions:

(1) Xml Comments
(2) Just follow the normal .NET guidelines
(3) Follow all fxcop rules (visual studio will show you a warning)
(4) I decided not to use unit tests, because there is less code which
can profit from unit tests.

The jpeg encoder and decoder is not from me. I use an existing library
called fjcore: http://code.google.com/p/fjcore/
Apr 7, 2011 at 10:44 AM

Hi malignate88,

thanks, I will commit the things I've done so far as soon as I am back from my current business trip to the US. This will be at the beginning of next week. Maybe we can do a skype session the weekend after. Probably you can have a look at the changes before. I have also developed a second filter that might be of use, which allows overlaying an image. So a second image is merged to an image dependent on the transparency value of this image.  When I'm back I will have a look at the jpeg decoder, as this is quite important to me.

Regards, max

 

Coordinator
Apr 7, 2011 at 11:22 AM
Hi max,

sounds very good. Btw: where are you from?

Sebastian

Am 4/7/2011 12:45 PM, schrieb maxpg:

From: maxpg

Hi malignate88,

thanks, I will commit the things I've done so far as soon as I am back from my current business trip to the US. This will be at the beginning of next week. Maybe we can do a skype session the weekend after. Probably you can have a look at the changes before. I have also developed a second filter that might be of use, which allows overlaying an image. So a second image is merged to an image dependent on the transparency value of this image. When I'm back I will have a look at the jpeg decoder, as this is quite important to me.

Regards, max


Coordinator
Apr 7, 2011 at 1:01 PM
Hi max,

just one thing. If you already have some code you can commit it as patch, then I can have a look before our meeting:

http://imagetools.codeplex.com/SourceControl/list/patches

Regards,
Sebastian

Am 4/7/2011 12:45 PM, schrieb maxpg:

From: maxpg

Hi malignate88,

thanks, I will commit the things I've done so far as soon as I am back from my current business trip to the US. This will be at the beginning of next week. Maybe we can do a skype session the weekend after. Probably you can have a look at the changes before. I have also developed a second filter that might be of use, which allows overlaying an image. So a second image is merged to an image dependent on the transparency value of this image. When I'm back I will have a look at the jpeg decoder, as this is quite important to me.

Regards, max


Coordinator
Apr 7, 2011 at 4:51 PM

I had a first look and I think the color space is probably CMYK.

I would just add a new value to the color space enum

    enum ColorSpace { Gray, YCbCr, RGB }

and update the method

    public Image FluxJpeg.Core.ChangeColorSpace(ColorSpace cs);

Allow CMYK to YCbCr and CMYK to RGB

CMYK to RGB:

1. CMYK to YCbCr

2. YCbCr to RGB

 

Unfortunatly we cannot detect if it is RGBA or not but by default jpeg does not support transparency, so I think it will not be RGBA

Coordinator
Apr 17, 2011 at 4:12 PM

Hi, are you back from your business trip?

Apr 17, 2011 at 9:00 PM

Yes I'm back again.  Unfortunately I had a lot to do last week. I hope I can give you a patch of the things I've done so far tomorrow.

I also think the color space is CMYK, I think I will need some more time before I can start on this issue. What I've done so far and will try to commit tomorrow is the following:

- bilinear filter for resizing images

- filter that allows adding an image to another image (something like a watermark)

I'm from austria, btw. Where are you from?

May 7, 2011 at 5:28 PM

I started working on the support of CMYK images. Unfortunately I still have problems with this. I tried to change the color space to RGB after loading the image but the image doesn't really look like it should... Do you have experience with stuff like that? Probably you would have some hints what could be the problem?

May 9, 2011 at 10:08 PM

BTW, I have developed two more resizing filters. A BicubicResizer and a BoxAveragingResizer (which finally gives me really good results for downscaling by a high factor). I will post a patch again in the next days.

Coordinator
May 10, 2011 at 5:11 AM
Sounds very good.

Unfortunatly I have no idea about this jpeg color mode. I made some tests ,but without success.

You are registered as developer now and can check them in directly. I will commit the patch the last next days.

Am 5/10/2011 12:08 AM, schrieb maxpg:

From: maxpg

BTW, I have developed two more resizing filters. A BicubicResizer and a BoxAveragingResizer (which finally gives me really good results for downscaling by a high factor). I will post a patch again in the next days.


May 10, 2011 at 6:54 AM

Can I login with my codeplex account to commit things or do I need other access data?

Coordinator
May 10, 2011 at 6:56 AM
Yes, you can use team explorer to commit it.

Am 5/10/2011 8:54 AM, schrieb maxpg:

From: maxpg

Can I login with my codeplex account to commit things or do I need other access data?


May 10, 2011 at 9:23 PM

I think I found the problem with the CMYK image. Acutally it has not been a CMYK but an YCCK image (seems to be some special color mode used by adobe when CMYK images are stored there...). So I think I found how I can distinguish between CMYK and YCCK images, but I still have to distinguish from RGBa. So still some work to do.

I tried to login to the Team Foundation Server of codeplex but it doesn't accept my username/password. Do you have a hint what could be the problem?