Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas023.isp.belgacom.be (localhost [127.0.0.1])
        by inav016.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AV-3.00) with ESMTP id k96MAXaE002875
        for <joris.at.lebbeke@skynet.be>; Sat, 7 Oct 2006 00:10:34 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx007.isp.belgacom.be (inmx007.isp.belgacom.be [195.238.5.89])
        by inas023.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AS-2.03) with ESMTP id k96MAO3Q019619
        for <joris.at.lebbeke@skynet.be>; Sat, 7 Oct 2006 00:10:29 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx007.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-2.32) with ESMTP id k96MAK83028477
        for <joris.at.lebbeke@skynet.be>; Sat, 7 Oct 2006 00:10:20 +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 k96Lws2T009561;
	Fri, 6 Oct 2006 18:00:03 -0400
Received: from mpls-qmqp-04.inet.qwest.net (mpls-qmqp-04.inet.qwest.net
	[63.231.195.115])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id k96LwqtF009558
	for <tiff@lists.maptools.org>; Fri, 6 Oct 2006 17:58:52 -0400
Received: from mpls-pop-14.inet.qwest.net (mpls-pop-14.inet.qwest.net
	[63.231.195.14]) by mpls-qmqp-04.inet.qwest.net (Postfix) with QMQP
	id 677DF22DC1C; Fri,  6 Oct 2006 21:58:51 +0000 (UTC)
Received: from 65-102-231-98.hlrn.qwest.net (HELO ?127.0.0.1?) (65.102.231.98)
	by mpls-pop-14.inet.qwest.net with SMTP; 6 Oct 2006 21:58:51 -0000
Date: Fri, 06 Oct 2006 16:03:36 -0600
Message-ID: <4526D2B8.5010406@qwest.net>
From: "Richard Nolde" <nrichard8@qwest.net>
To: tiff@lists.maptools.org, "Joris" <joris.at.lebbeke@skynet.be>
User-Agent: Thunderbird 1.5.0.7 (Windows/20060909)
MIME-Version: 1.0
References: <200610051603.k95G3DSF021473@duke.maptools.org>
In-Reply-To: <200610051603.k95G3DSF021473@duke.maptools.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: 
Subject: [Tiff] Inverting color space values in a TIFF file
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.00001b86
X-MSP-STORE: Sat, 07 Oct 2006 00:10:41 --21-99
Status:   

Tiff list:
I'm working a an extension to tiffcrop that will invert the color space 
of an image. 
For Bilevel and Grayscale images, this makes sense.  I use it to convert a
negative microfilm image to a positive one.

However, is there a meaningful inversion of a palette color or an RGBA image
and would this be done by modifying the palette rather than the data 
that points
into the palette/lookup tables?  What sort of algorithm should be 
applied to the
data in the palettes?  Eg for 8 bit grayscale, I just subtract the value 
from 255
and for bilevel data, I just invert the bits with ones complement 
operator. Doing
the same for palette images produces viewable but bizarre images.  Instead,
should I simply subtract the values in the palette from 255 for 8 bit 
per color
images?  I assume an Alpha Channel value would not be modified.

My version runs successful on images that have a multiple of 8 bits per 
pixel and
1 bit per pixel, but I doubt that inverted palette color images mean 
anything to anyone.
Is there any point in allowing such images to be Inverted?

Richard Nolde


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