Solved

jai image overlay

Posted on 2002-04-18
8
1,544 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
Comment Utility
JAI does not support transparent gif.
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
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
Comment Utility
Moondancer, this question is not even one week old.
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 1

Author Comment

by:steeks
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
More than two months later, please update and finalize this.
Moondancer - EE Moderator
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now