1

I am trying to attach the transparent alpha channel to png image in java. Image should not be changed after merging of alpha channel. In short,

  1. I have png image of dimension p X q
  2. I have alpha channel(transparent) of 100% transparency and of size p X q
  3. Above both images(1 and 2) should be merged and image 1 should remain as it is without any effect of alpha channel... Please help me out...
lbalazscs
  • 17,474
  • 7
  • 42
  • 50
Rajnikant
  • 43
  • 1
  • 7

1 Answers1

2

You need to set the alpha channel in the first image according to the transparency information in the second image. Something like this: Set BufferedImage alpha mask in Java

If you don't want to have any changes in the first image, then you can create a copy/clone of it and work with this copy. Here's how to create a copy of a BufferedImage: How do you clone a BufferedImage

Community
  • 1
  • 1
lbalazscs
  • 17,474
  • 7
  • 42
  • 50
  • Is there a way to set a single alpha parameter -i.e. making the mask a single constant vector?. I tried the cited solution though i figured if there is any efficient solution for this simpler case....... – Brethlosze Mar 28 '15 at 08:40