Skip to main content

Subtracting two RenderedImages manually

2 replies [Last post]
deadpassive
Offline
Joined: 2009-02-05
Points: 0

Hi,

I want to subtract one RenderedImage from another to create a new difference image. The problem is I need to ignore pixels which have a certain value in either of the input images.

Is there a way of doing this using JAI operators? I was thinking of creating some kind of mask which I could apply to the result of the subtraction.

Failing that, how could I manually subtract the images without using the JAI Subtract operator? I understand I can loop through pixel by pixel, but I don't know how to create a new blank image from scratch to put the results in.

Any help would be appreciated.

Thanks,

Jon

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pentath
Offline
Joined: 2009-08-04
Points: 0

Can you describe what you want in the output image where one or both inputs has the ignore value? Depending on the answer, the threshold operator might do the trick.

deadpassive
Offline
Joined: 2009-02-05
Points: 0

Hi, thanks for the reply. In the output image I would like some pre-defined to take the place of those pixels which I want to 'ignore' from the subtract operation. Usually this would be some nodata value like -1 or 0.

Jon