Solved

jai image overlay

Posted on 2002-04-18
8
1,548 Views
Last Modified: 2007-12-19
I am trying to dynamically watermark an image, so that it can be served via an applet.

I will be starting with a tiff image, that I would like to overlay a water mark with "sample" over the original image.

I have been experimenting with gif imagages to start with and have thought about using a transparent gif image; the watermark with JAI.create("overlay",src1,src2) to create the output RenderedImage.

The problem I am having with this, is that when I create a RenderedImage based on the transparent gif file, it is not decoding it properly, thus the resulting image is simply all black.

i'm not sure how to decode/encode the images properly and the following code is my attempt at opening, combining and saving images:
       public RenderedImage im1;
       public RenderedImage im2;
       public RenderedImage im3;
       private final String baseImFile = "base.gif";
       private final String waterImFile = "trans.gif";

      im1 = JAI.create("fileload",baseImFile);
      im2 = JAI.create("fileload",waterImFile);
      im3 = JAI.create("overlay",im1,im2);
      JAI.create("filestore",im3,"newFile.gif");

How can I encode/decode the images properly to get the resulting image I'm after?

Once I get this to work, can i use a "base" tiff image with a "transparent" gif overlay? If not, any clues on how I go about this?

Thanks
0
Comment
Question by:steeks
  • 4
  • 3
8 Comments
 
LVL 9

Expert Comment

by:yongsing
ID: 6952514
JAI does not support transparent gif.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6956293
This question is current, others below are not.  Some have had zero activity, for which you may wish a refund so you can ask them again to draw current attention.  Let us know please.

ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in seven days.  Please post closing recommendations before that time.

Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.11686878.html
http://www.experts-exchange.com/questions/Q.20174450.html
http://www.experts-exchange.com/questions/Q.20174444.html
http://www.experts-exchange.com/questions/Q.20179760.html
http://www.experts-exchange.com/questions/Q.20188778.html
http://www.experts-exchange.com/questions/Q.20195508.html
http://www.experts-exchange.com/questions/Q.20239488.html
http://www.experts-exchange.com/questions/Q.20250391.html
http://www.experts-exchange.com/questions/Q.20290851.html




*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations if this item remains inactive another seven (7) days.  If you are interested in the cleanup effort, please click this link http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643 
POINTS FOR EXPERTS awaiting comments are listed here -> http://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange
0
 
LVL 9

Expert Comment

by:yongsing
ID: 6957627
Moondancer, this question is not even one week old.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 1

Expert Comment

by:Moondancer
ID: 6957976
ypongsing ->  True, but as you see the list, one item dates back to the year 2000.  The goal is to provide ALL open/locked questions to request that everyone manages all their open questions, en toto.  This is why I added this verbiage to the beginning of this follow-up request.
This question is current, others below are not.  Some have had zero activity, for which you may wish
a refund so you can ask them again to draw current attention.  Let us know please.

Thanks,
Moondancer - EE Moderator
0
 
LVL 1

Author Comment

by:steeks
ID: 6959300
Thats all very well and good, but it would be nice if someone could actually post some comments that actually help with the problem..
0
 
LVL 9

Accepted Solution

by:
yongsing earned 200 total points
ID: 6959908
steeks, post your question in the JAI discussion group. One of the Sun Engineer should be able to help you. Here's the URL:

http://archives.java.sun.com/cgi-bin/wa?A0=jai-interest
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6961002
Just to clarify, steeks, the urgency to close is not with this question.  The term "abandoned" question refers to any that have been inactive 21 days or longer.  I posted the above reminder to let you see all your open items as of that date, some of which are quite old.

Thank you, yongsing, for your help and ongoing support.  It is appreciated.

Moodancer - EE Moderator
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7118724
More than two months later, please update and finalize this.
Moondancer - EE Moderator
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
varialbe initialization 11 37
configure dependency in POM for new database 3 34
going to wrong jsp page 2 33
hashmap order 17 37
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question