Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas013.isp.belgacom.be (localhost [127.0.0.1])
        by inav013.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AV-3.00) with ESMTP id k669px40016032
        for <joris.at.lebbeke@skynet.be>; Thu, 6 Jul 2006 11:52:00 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx018.isp.belgacom.be (inmx018.isp.belgacom.be [195.238.4.79])
        by inas013.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AS-2.03) with ESMTP id k669ppDF028940
        for <joris.at.lebbeke@skynet.be>; Thu, 6 Jul 2006 11:51:52 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx018.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-2.32) with ESMTP id k669poxm027821
        for <joris.at.lebbeke@skynet.be>; Thu, 6 Jul 2006 11:51:50 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id k669fe0J030275;
	Thu, 6 Jul 2006 05:42:45 -0400
Received: from zynlfw01.zylab.com (mx.zylab.com [194.178.9.130])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id k669fc94030272
	for <tiff@lists.maptools.org>; Thu, 6 Jul 2006 05:41:38 -0400
Received: from zynlms01.ZyLAB.WAN (unknown [192.168.1.10])
	by zynlfw01.zylab.com (Postfix) with ESMTP id A3659281;
	Thu,  6 Jul 2006 11:29:49 +0200 (CEST)
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Subject: Re: [Tiff] CMYK Tiff
Date: Thu, 6 Jul 2006 11:38:53 +0200
Message-ID: <FC840EC0BF7BFA45A0F94548AF36920DABF2FE@zynlms01.ZyLAB.WAN>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [Tiff] CMYK Tiff
Thread-Index: AcagRn1DuRFbS6UzTRaImfVeSCRoGAAlB+NQ
From: "Gerben Vos" <Gerben@zylab.com>
To: <tiff@lists.maptools.org>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by duke.maptools.org id
	k669fc94030272
Cc: 
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.0000183e
X-MSP-STORE: Thu, 06 Jul 2006 11:52:09 +0200
Status:   

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.

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
