| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2005.05.26 08:37 "Re: Jpeg and YCbCr", by Jean-yves Le RidantHello yourpattern, > I have already done the things like you said,comment the > TIFFSetFiled(m_tif,TIFFTAG_JPEGCOLORMODE,JPEGCOLORMODE_RGB)...,but > still doesn't work. Hum ..., what I said was *un*comment this line. JPEGCOLORMODE_RGB must be understood from "jpeg compressor point of view', not exactly standard but a common practice, baseline, .... of converting RGB to YCC. In clear, with this flag, RGB is automatically converted to/from YCC. > then i use my code to read this pic, > and save it with compression = COMPRESSION_JPEG & photometric = PHOTOMETRIC_YCBCR > with tiffdump,i saw follows:(FILE 2) > Magic: 0x4949 <little-endian> Version: 0x2a > Directory 0: offset 19642 (0x4cba) next 0 (0) > ImageWidth (256) SHORT (3) 1<422> > ImageLength (257) SHORT (3) 1<158> > ... > After doing some comparing things,i found almost every tag is same. > except for the StripBytesCounts ,and the file i created has one tag RowsPerStrip > which the file ACDSEE created didn't have. > but this file(i created) still can't be opened by ACDSEE5. Seems like if ACDSEE don't want stripped files .... :-((( This dump is consistant with JPEGCOLORMODE_RAW and PHOTOMETRIC_YCBCR, if you have set somewhere YCBCRSUBSAMPLING to 1,1. What I do not understand is why tiffdump "UNDEFINE" à well formed JPEGTABLE field. ( 2 fields, so there also, consistant with a JCS_YCC). > I opened this file(I created,file 2) in LeadTools ,the image color seems changed a > lot. so i modify the Photometric tag value from 6 to 2,(PHOTOMETRIC_YCBCR =6,& > PHOTOMETRIC_RGB=2),this time the color seemed right.(in Leadtools,ACDSEE can't > open it). Such practice may produce hasardous results, cause of possible traitements by the a jpeg decompressor of fields infos in the jpeg stream. When you do this, your file is "basically" incorrect. If photometric is something else than YCBCR, the infos in jpeg stream must reflect an "unknown" colorspace. -- Jean-Yves |
|||||||