AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
July 2006

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2006.07.05 14:38 "CMYK Tiff", by Ivan Kopcanski
2006.07.06 09:38 "Re: CMYK Tiff", by Gerben Vos
2006.07.06 11:56 "Re: CMYK Tiff", by Gerben Vos
2006.07.07 07:06 "Re: CMYK Tiff", by Ivan Kopcanski
2006.07.07 09:20 "Re: CMYK Tiff", by Gerben Vos

2006.07.06 09:38 "Re: CMYK Tiff", by Gerben Vos

Ivan Kopcanski wrote:
>
> I work on a c# project and I am asked to make CMYK tif file.
>
> What I need to do is to make CMYK tif file with square painted with
> specified color and properly placed on white painted image.
>	 
> How it is possible to do using libtiff.dll? GDI+ gives possibility
> to save RGB tif files.

You cannot paint squares or other things with libtiff. It only works
with raw bitmap data.

However, what you could do for example, is construct the image using
GDI+ (or something else), then retrieve the bitmap data (from the
documentation it looks like you need to use Bitmap.LockBits for that),
convert that from RGB to CMYK and then pass it on to libtiff.
You can probably find out how to do that conversion on many places on
the internet; one place is in the PDF specification (section 6.2:
Conversions among device color spaces).

Although the Windows bitmap format aligns scanlines on multiples of
4 bytes, while TIFF uses 1-byte alignment, this doesn't matter in this
case because CMYK uses 4 bytes per pixel.

Write the TIFF with TIFFTAG_PHOTOMETRIC = PHOTOMETRIC_SEPARATED. You can
also set TIFFTAG_INKSET = INKSET_CMYK and TIFFTAG_NUMBEROFINKS = 4, but
those two are optional and default to these values anyway.

					Gerben Vos.