i want apply some filters [image filter] on Region Of Interest that user selected.
i need API for getting pixels of this area [polygon or freehand also Rectangle] and apply
filter.any Suggestion for this work ?
i want apply some filters [image filter] on Region Of Interest that user selected.
i need API for getting pixels of this area [polygon or freehand also Rectangle] and apply
filter.any Suggestion for this work ?
Basically, what you need to do is:
In pseudocode:
private BufferedImage bufferedImage = new BufferedImage()
private Graphics2D graphics = bufferedImage.createGraphics()
void paint(Graphics2D input) {
graphics.clip(selectionArea.getShape())
upperCanvas.paint(graphics)
BufferedImageOp op
bufferedImage = op.filter(bufferedImage, new BufferedImage())
input.drawImage(bufferedImage)
}
For applying filter, see java.awt.image
As you can see, this can be done in java2d, but the API is quite complicated. If you're interested I can suggest pulpcore as a replacement framework. It includes several predefine filters and a one-line-API for apply them. See demo. Also includes a Java2DSprite class for easy porting between pulpcore and java2d.