Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

CMYK Merge->Save->Display, What to Do?
Started by RLenski at 06-17-2008 17:03. Topic has 6 replies.

Print Search « Previous Thread Next Thread »
  06-17-2008, 17:03
RLenski is not online. Last active: 10/25/2007 10:31:36 PM RLenski

Top 150 Posts
Joined on 02-02-2006
Posts 19
CMYK Merge->Save->Display, What to Do?
Reply Quote

I am having problems merging a cmyk color separation tifs, saving the merged file into one tif and then displaying the same image file.  The foremost problem is that I want to get the cmyk colors to display properly on the display application.  I have tried the following:

1. Load cmyk bitmaps, do a Bitmap.ColorMerge(COLORSEP_CMYK), and then Bitmap.Save("C:\\Test.tif", FILE_TIFLZW, 8, PQ1, 1 ).  When displaying that image file in the LBitmapWindow, the colors are not correct.  Particularly the cyan and magenta show up very bright (no doubt because of the cmyk to rgb conversion).  The load time is fast, but the colors are wrong.

2. Load the cmyk bitmap handles into a pBITMAPHANDLE array, with an LFile do a SaveCMYKArray(CMYKHandlesArray, 4, FILE_TIFLZW_CMYK, 8, 2, 0, NULL).  In this example the colors actually display properly in the LBitmapWindow, but the load time is extremely long.  Even with the 8 bit image file (3mb file), the load time takes about 50 seconds which is unacceptable.

 This brings me to my problem.  Is there any other way to get a cmyk converted properly to display properly on an rgb monitor (this is on a color calibrated monitor)?  Maybe I am missing a step for converting, or displaying?  I know that there has to be some conversion done, I just can't figure out how with leadtools.  I have license numbers for both versions of 14.5 and 15 raster pros.  Any help would be greatly appreciated to get this to work.  I don't know why this is such a problem displaying a cmyk properly on a monitor.

 

Thanks for any help.

Rich


   Report 
  06-18-2008, 11:55
Adam Boulad is not online. Last active: 11/20/2008 3:23:08 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 513
Re: CMYK Merge->Save->Display, What to Do?
Reply Quote

Rich,

Do you have the 4 CMYK planes in separate images? If yes, you can display them in LEADTOOLS without converting to RGB by using the LPaint::PaintDCCMYKArray function. If this doesn't solve the problem for you, try to merge the images using our pre-compiled demos. Do they merge correctly? You can do that by loading the images to the demo (CMYK images) and from File-> Color Merge specify the C M Y K images.


Adam Boulad
LEADTOOLS Technical Support

   Report 
  06-18-2008, 12:52
RLenski is not online. Last active: 10/25/2007 10:31:36 PM RLenski

Top 150 Posts
Joined on 02-02-2006
Posts 19
Re: CMYK Merge->Save->Display, What to Do?
Reply Quote

Adam,

Thanks for answering my post.  Yes, the 4 planes are in seperate image files.  Even though I am displaying the image files, I need to get the cmyk to a managable combined file that has the correct colors.  I have used the colormerge() function originally, but that is where the colors aren't correct.  I load the 4 bitmaps into a LBitmap Array, do a ColorMerge() with a COLORSEP_CMYK parameter and the 4 files, but the colors are incorrect.  I have been able to get the colors properly and into a rgb tif file, but the process is somewhat tedious.  The files are 150 dpi tif files all around 350kb. I have posted the code that works, but the process takes about 65 seconds to merge the cmyk to the rgb tif file.  I also have to create the file as a cmyk, save it, then reopen it and save it again as a tif lzw.  Is there anyway to skip the save and reopening the file?  The loading portion of the cmyk file into the LBitmap is what takes about 45 seconds?  What I think would work is passing a FILE_TIFLZW into the SaveCMYKArray(), but it is errors as an invalid parameter.  Anyways, any help to speed up the processing of the file would be greatly appreciated.  The colors are now correct for the tif file and loads quickly into the bitmap.  It is just the process of converting the 4 planes into the rgb tif file with the correct colors and in a reaonable process time.  Thanks for any help.

Thanks,

Rich

LBitmap  Planes[4];
int stat = Planes[0].Load((L_TCHAR*)(LPCTSTR)PageLocation);
Planes[0].Invert();

stat = Planes[1].Load((L_TCHAR*)(LPCTSTR)PageLocation);
Planes[1].Invert();

stat = Planes[2].Load((L_TCHAR*)(LPCTSTR)PageLocation);
Planes[2].Invert();

stat = Planes[3].Load((L_TCHAR*)(LPCTSTR)PageLocation);
Planes[3].Invert();

pBITMAPHANDLE CMYKHandlesArray[4] = {  Planes[0].GetHandle(), Planes[1].GetHandle(),
                                                                               Planes[2].GetHandle(), Planes[3].GetHandle()};

// Save as cmyk
CString  FileName = "C:\\Test.tif";
LFile      LeadFile;
LeadFile.SetFileName(FileName.GetBuffer(1));
stat = LeadFile.SaveCMYKArray(CMYKHandlesArray, 4, FILE_TIFLZW_CMYK, 8, 2, 0, NULL);

// Open and save as rgb
LBitmap NewBitmap;
stat = NewBitmap.Load(FileName.GetBuffer(1));
stat = NewBitmap.Save(FileName.GetBuffer(1), FILE_TIFLZW, 8, PQ1, 0 );


   Report 
  06-19-2008, 11:09
Adam Boulad is not online. Last active: 11/20/2008 3:23:08 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 513
Re: CMYK Merge->Save->Display, What to Do?
Reply Quote
Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;}

Rich,

FILE_TIFLZW cannot be used with SaveCMYKArray function, because this function only saves CMYK images.

 

When using the default loading functions (e.g. LBitmap::Load) on a CMYK image, it will perform color conversion to RGB (usually BGR order), which is what takes a lot of time.

 

One way of speeding the file loading is to use the ELO_USEFASTCONVERSION flag when passing the LOADFILEOPTION structure to the Load function. This flag will greatly speed up the loading of CMYK files, but it will probably reduce the image quality. I expect this to give you results similar to the ColorMerge function you tried in the past.

 

Also, you can save the file using the SaveCMYKArray with file format FILE_TIF_CMYK (no-compression) this will likely increase the speed of saving/loading because you will eliminate the LZW compression/decompression steps.

 

If these solutions are not acceptable to you, please send me the 4 planes images to check the color merge function with the images.

You can either send an email to support@leadtools.com and mention this post or post your attachments here.

Please include the images in a ZIP or RAR file. And if you are posting here do not use the 'Preview' feature.


Adam Boulad
LEADTOOLS Technical Support

   Report 
  06-19-2008, 13:20
RLenski is not online. Last active: 10/25/2007 10:31:36 PM RLenski

Top 150 Posts
Joined on 02-02-2006
Posts 19
Re: CMYK Merge->Save->Display, What to Do?
Reply Quote

Adam,

I had no luck with your suggestions.  I have emailed the support per your request.  Thanks for your help.

Thanks,

Rich


   Report 
  06-22-2008, 11:16
Adam Boulad is not online. Last active: 11/20/2008 3:23:08 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 513
Re: CMYK Merge->Save->Display, What to Do?
Reply Quote
Rich,
I have received your email, and I will continue to work with you through emails and post the final results here.
Adam Boulad
LEADTOOLS Technical Support

   Report 
  07-02-2008, 10:31
Adam Boulad is not online. Last active: 11/20/2008 3:23:08 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 513
Re: CMYK Merge->Save->Display, What to Do?
Reply Quote
After investigating this issue, the problem was solved when applying the latest version of DLLs, and making sure to include the needed DLLs (specially Ltclr15u.dll).
Adam Boulad
LEADTOOLS Technical Support

   Report 
Post
LEAD Support Fo... » Developer » Image Processin... » CMYK Merge->Save->Display, What to Do?

Powered by Community Server, by Telligent Systems