2

This feature exists in Photoshop CS2: take a layer that has some transparency, and create a layer that will blend with it to provide effects like 'emboss' and 'inner or outer glow'.

I'd like to know how to achieve similar effects in Java2D.

I can imagine a couple of ways of how I'd start to do it, but I'd like to know if someone has an efficient way before I start.

I've looked for similar effects online, but the one at JH Labs isn't very explanatory or generic, and the one for 'Filthy Rich Clients' mentioned in another answer uses blur, and that's not generic either. The variability available to Photoshop should be in any suggestion provided as an answer to this question.

Tom
  • 830
  • 1
  • 5
  • 13

1 Answers1

0

Do you mean "layer effects" in Photoshop? What is the problem with blurring?

You can start with either the JH Labs filters or with the SwingX funcionality (this has a large overlap with the methods described in the Filthy Rich Clients book), these are the best generic image-manipulation libraries for Java2D.

Note that you should ask concrete questions like what exactly do you want to implement (what is "similar" enough to Photoshop?)? What did you not understand about the JH Labs effects?

lbalazscs
  • 17,474
  • 7
  • 42
  • 50
  • To provide the emboss effect some processing must happen to decide the area to 'emboss', and that's the main problem I have. The few things you suggest don't explain the process. Blur (used in FRC) isn't the same as this; it might be used in some post-processing, but it isn't possible to achieve the variety of contours and lighting effects as in PS. JHL has some contouring from what I can see, but it isn't fully generic, and there isn't any comprehensive documentation. Thanks – Tom Oct 24 '13 at 06:03
  • I think blur can help to decide the area to 'emboss': if you blur the image with the transparency, then you will have some pixels which are partially transparent at the edges, and you can say for example that pixels that have now a transparency less than 50% AND they are outside the original image are the area you need. – lbalazscs Oct 24 '13 at 20:44