Click here to Skip to main content
15,888,096 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have applied an image watermark to an image using the com.sun.image.codec.jpeg.JPEGImageEncoder since I'm using an DCT algorithm for watermarking.
My problem is how to extract the watermark from the image and obtain the watermark and original image as separate images. I tried using JpegImageDecoder
. But I'm not much used of this part . Can u pls help me how to extract the watermark?
This is what I tried
File file=new File("Z:\\Image\\WatermarkedImage.jpg");
FileInputStream in=new FileInputStream(file);
JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder( in );
BufferedImage img = decoder.decodeAsBufferedImage();

RenderedImage im = img;


ImageIO.write(im, "jpeg", new File("Z:\\Image\\extract.jpg"));


Thanks in advance
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900