From: Russ Cox <russcox@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] color compositing
Date: Tue, 14 Sep 2004 21:19:08 -0400 [thread overview]
Message-ID: <ee9e417a0409141819253407e@mail.gmail.com> (raw)
In-Reply-To: <564b487b1feec76d33fa694aabe072ad@plan9.ucalgary.ca>
> 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
next prev parent reply other threads:[~2004-09-15 1:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-14 23:52 andrey mirtchovski
2004-09-15 1:19 ` Russ Cox [this message]
2004-09-15 1:24 ` andrey mirtchovski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ee9e417a0409141819253407e@mail.gmail.com \
--to=russcox@gmail.com \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).