From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <564b487b1feec76d33fa694aabe072ad@plan9.ucalgary.ca> To: 9fans@cse.psu.edu Date: Tue, 14 Sep 2004 17:52:10 -0600 From: andrey mirtchovski MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] color compositing Topicbox-Message-UUID: e21868f8-eacd-11e9-9e20-41e7f4b1d025 i'm in a pickle here trying to find out how to use duff/porter's alpha channels properly. here's the situation: - there is an image with background color which should be transparent - this image, sans the background color, should go onto another image the problem is that i'm not able to extract the non-background color from the image. obviously the easiest soution would be to use a mask for anything that non-background, so the first thing i tried was to use the image as a mask on a 'draw everything in white on black background'. the problem i ran into was that if i use a low-bit channel (GRAY1) i only see the parts of the image which were bright enough originally, if i use a higher-bit channel i get variations of grey causing everything drawn afterwards to appear black'n'white... then i tried several of the duff/porter compositing operators with absolutely no effect whatsoever. in my desperation i even tried creating an image with the alpha for the particular color set to zero, but it proved fruitless. to summarize: how can i remove a certain color from an image programmatically? andrey