Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > composite two images

Reply
Thread Tools

composite two images

 
 
fireman
Guest
Posts: n/a
 
      11-04-2010
Hi, I am new to java and hope you guys can help me.

I have two images. One is just oridinary color images. Another one is
a gray scale "mask" image with limited pixels values. Some pixels in
the mask images have value 6, some pxies have 7, some have 8, some
have 9. All other pixels have value 0. I would like to composte the
two images in the following way:

For the region in the mask image represented by pixels value 6,
overly semi-transparent (alphe=0.5) red on the original image. For
region with mask value 7, overly semi-transparent green. For value 8,
semi blue. Fior value 9, semi yellow.

How can I do it? If you guys could write some code, that would be
great.

Thank you very much.

Fireman
 
Reply With Quote
 
 
 
 
John B. Matthews
Guest
Posts: n/a
 
      11-05-2010
In article
<(E-Mail Removed)>,
fireman <(E-Mail Removed)> wrote:

> Hi, I am new to java and hope you guys can help me.
>
> I have two images. One is just oridinary color images. Another one is
> a gray scale "mask" image with limited pixels values. Some pixels in
> the mask images have value 6, some pxies have 7, some have 8, some
> have 9. All other pixels have value 0. I would like to composte the
> two images in the following way:
>
> For the region in the mask image represented by pixels value 6,
> overly semi-transparent (alphe=0.5) red on the original image. For
> region with mask value 7, overly semi-transparent green. For value 8,
> semi blue. Fior value 9, semi yellow.
>
> How can I do it?


If the two images are conformal, one approach would be to walk through
the Raster [1] associated with each BufferedImage [2], reading and
writing pixels values as desired. Alternatively, you might use LookupOp
[3], as seen in this example [4].

[1]<http://sites.google.com/site/drjohnbmatthews/raster>
[2]<http://download.oracle.com/javase/6/docs/api/javax/imageio/ImageIO.html>
[3]<http://download.oracle.com/javase/6/docs/api/java/awt/image/LookupOp.html>
[4]<http://www.java2s.com/Code/Java/2D-Graphics-GUI/Imagedemo.htm>

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Composite vs non composite Controls Mike ASP .Net Web Controls 4 03-11-2005 05:47 AM
Losing Composite Control property that another Composite Control ... Chad ASP .Net Building Controls 0 02-01-2005 09:01 PM
Possible to create a composite control that has a child control that is a validator that validates the composite control itself? Jonathan Eric Miller ASP .Net Building Controls 2 07-22-2004 10:58 PM
Composite control with dynamic composite controls sleigh ASP .Net 1 02-12-2004 06:24 PM
Composite Images CDB Java 0 07-16-2003 07:12 PM



Advertisments