Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas028.isp.belgacom.be (localhost [127.0.0.1])
        by inav017.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AV-3.00) with ESMTP id k8H3EluA027747
        for <joris.at.lebbeke@skynet.be>; Sun, 17 Sep 2006 05:14:47 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx016.isp.belgacom.be (inmx016.isp.belgacom.be [195.238.4.219])
        by inas028.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AS-2.03) with ESMTP id k8H2q3LR006984
        for <joris.at.lebbeke@skynet.be>; Sun, 17 Sep 2006 05:14:43 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx016.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-2.32) with ESMTP id k8H2TxNE030927
        for <joris.at.lebbeke@skynet.be>; Sun, 17 Sep 2006 04:30:00 +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 k8H2AJHn018305;
	Sat, 16 Sep 2006 22:11:03 -0400
Received: from mailout15.yourhostingaccount.com
	(mailout15.yourhostingaccount.com [65.254.253.123])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id k8H2AH6n018302
	for <tiff@lists.maptools.org>; Sat, 16 Sep 2006 22:10:17 -0400
Received: from scan04.yourhostingaccount.com ([10.1.1.234]
	helo=scan04.yourhostingaccount.com)
	by mailout15.yourhostingaccount.com with esmtp (Exim)
	id 1GOm6p-0004Ka-Kq
	for tiff@lists.maptools.org; Sat, 16 Sep 2006 22:10:16 -0400
Received: from authsmtp07.yourhostingaccount.com ([10.1.18.7] ident=exim)
	by scan04.yourhostingaccount.com with spamscanlookuphost (Exim)
	id 1GOm6p-0005oa-Gk
	for tiff@lists.maptools.org; Sat, 16 Sep 2006 22:10:15 -0400
Received: from authsmtp07.yourhostingaccount.com ([10.1.18.7]
	helo=authsmtp07.yourhostingaccount.com)
	by scan04.yourhostingaccount.com with esmtp (Exim)
	id 1GOm6p-0005oX-4O
	for tiff@lists.maptools.org; Sat, 16 Sep 2006 22:10:15 -0400
Received: from [202.164.193.21] (helo=[10.0.0.1])
	by authsmtp07.yourhostingaccount.com with esmtpsa (TLSv1:RC4-MD5:128)
	(Exim) id 1GOm6m-0006EK-Cp
	for tiff@lists.maptools.org; Sat, 16 Sep 2006 22:10:12 -0400
Message-ID: <450CADF9.6020400@argyllcms.com>
Date: Sun, 17 Sep 2006 12:07:53 +1000
From: Graeme Gill <graeme2@argyllcms.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
	rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: tiff@lists.maptools.org
Subject: Re: [Tiff] is there alpha component present
	in	GrayscaleorPalettecolorimage
References: <AA6DDFA4E046A24585BC828A78155B47B313B8@US-MAIL.ingrnet.com><Pine.SOC.4.60.0609151249530.2127@blade.simplesystems.org><004101c6d9ca$f6bed300$258ff651@dfgrrxsknr4e>	<Pine.SOC.4.60.0609161542140.2127@blade.simplesystems.org>	<002601c6d9da$12232970$258ff651@dfgrrxsknr4e>	<F8DC4A45-83A4-4571-A174-D6754781DB6D@smartgames.ca>
	<004801c6d9de$00b11450$258ff651@dfgrrxsknr4e>
In-Reply-To: <004801c6d9de$00b11450$258ff651@dfgrrxsknr4e>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-EN-UserInfo: 4278ddcaa0afbc5edf619268be555fc4:fcefc52a98eff5eb12ac042c4438d4fd
X-EN-AuthUser: graeme@argyllcms.com
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: graeme@argyllcms.com
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.00001a75
X-MSP-STORE: Sun, 17 Sep 2006 05:14:53 +0200
Status:   

Joris wrote:

> challenge here is to somehow involve alpha in that scheme. Is RGBA
> (20,20,20,20) closest to RGBA (20,20,100,20), or is it closest to RGBA
> (20,20,20,100)? Put more generally, you need to weigh color difference
> against alpha difference, and it's not quite clear how to avoid making
> rather arbitrary weight decisions.

That doesn't seem that difficult. Assume the most sensitive situation
(ie., against an opaque neutral background), and compute the RGB color that
would result from that RGBA value. Convert color distance to a more visual
metric if you like (L*a*b* maybe), and apply the usual color quantization
algorithms in 4D, rather than 3D (I used to like the variance cut that I
put in xli).

The main limitation would be that your palette may be rather small
when measured against the 4D space you're trying to quantize,
and the result may not be that visually appealing.
One trick that would help would be to scale the Alpha dimension
so that it is quantized more coarsely, freeing up more palette
entries for colors.

(This seems all rather similar to the types of things I do in
arriving at an "optimal" CMYK test point set used for color
profiling, the Alpha being analogous to K ....)

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