From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Tue, 14 Sep 2004 21:19:08 -0400 From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] color compositing In-Reply-To: <564b487b1feec76d33fa694aabe072ad@plan9.ucalgary.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <564b487b1feec76d33fa694aabe072ad@plan9.ucalgary.ca> Topicbox-Message-UUID: e2256f1c-eacd-11e9-9e20-41e7f4b1d025 > to summarize: how can i remove a certain color from an image > programmatically? first make the "image with background color which should be transparent" into an "image with transparent background": read it into a Memimage of (say) RGBA32, then loop over the pixels looking for your particular color and replacing them with 0,0,0,0. (actual transparent pixels.) then you can draw(dst, dst->r, bottom, nil, ZP); draw(dst, dst->r, image, nil, ZP); and voila! you have your image. russ