Hi,

Aha!

Found why... this profile is handling the particular encoding used by tiff,
so the profile is capable to decode a YCbCr tiff by feeding it from raw
uninterpreted data.

Just tried this:

icctrans -oYCC709.icm

Enter values, 'q' to quit
R (0..255)? 0
G (0..255)? 0
B (0..255)? 0

Y=16.42 Cb=127.61 Cr=127.46

So actually, 0, 0, 0 represents this value instead of Y=0, Cb=0, Cr=0

tifficc throws the data obtained form TIFFReadEncodedStrip directly
to the profile.

Regarding CSA (why people calls CSA to that?) I will try to incorporate
it to 1.11.

Regards,
Marti Maria
The little cms project
http://www.littlecms.com
[EMAIL PROTECTED]

----- Original Message ----- 
From: "Lars Ruben Skyum" <[EMAIL PROTECTED]>
To: "'Marti Maria'" <[EMAIL PROTECTED]>; "Lcms-User" <[EMAIL PROTECTED]>
Sent: Monday, August 04, 2003 3:41 PM
Subject: RE: [Lcms-user] 1: Converting from YCbCr to RGB + 2: CSA output


> And this works fine to me...

Ok, I will have to give it another try then.

> just as example, libtiff site
> has a sample of non subsampled
> YCbCr TIFF that can be handled by tifficc
> ftp://ftp.remotesensing.org/pub/libtiff/ycbcrbug11.tif

The image I was testing with was actually a subsampled test image from libtiff:

http://remotesensing.org/cgi-bin/cvsweb.cgi/osrs/libtiffpic/quad-jpeg.tif

tifficc does not read it, but ImageMagick does. The strange thing is, converting among 
Gray, RGB, and CMYK profiles works fine with
ImageMagick, but anything involving the YCC709.icm profile fails, giving wrong colors 
in the output image. I'm very confident the
code is ok (like I said, it works when converting among gray, RGB, and CMYK colors), 
it simply converts one pixel at a time like
this:

      struct Pixel
      {
        unsigned char r,g,b;
      } alpha, beta;

      alpha.r = 0;
      alpha.g = 0;
      alpha.b = 0;

      beta.r = 0;
      beta.g = 0;
      beta.b = 0;

      cmsDoTransform(hXForm, &alpha, &beta, 1);

- if alpha is (0,0,0) before the call to cmsDoTransform, beta is (15,91,0) after the 
call. And of course I made sure that the
profile descriptors were correct (one byte per pixel component, correct colorspace, 
etc).

> YCbCr is not very standarized at all.

Could this be my problem?

>
> What I do not undestand is why SWOP doesn't work... I'm using
> CMYK conversions almost
> everyday without problems. Anyone else has experienced that?

Oh, but SWOP works beautifully, *except* with the YCC709.icm profile (fails just like 
sRGB colors). The problem, then, is with my
code in ImageMagick (likely) or with LCMS handling of YCbCr profiles (unlikely, if it 
works for you).

> >
> >
> > /Current exch /ColorSpace defineresource pop
>
> Yep, I did in such way because I needed in such way :-) but I
> could try to make things easier.
> Any suggestions?

Yes, it would be nice if it just returned the array [/CIEBasedDEFG .... ]. Any 
postscript code may easily be added by the
application integrating LCMS.

Thanks for you replies.

/Lars




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Lcms-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to