I have a grayscale image stored in a BufferedImage as TYPE_BYTE_GRAY that I
want to run through a sharpening filter.  However, the results I get when
doing this in Java is far inferior to what I get when I load the image in
Paint Shop Pro (PSP) and run it through a sharpen filter in this
application.  I have a few thoughts on why this might be -

1.  Before I can sharpen the image in PSP I am forced to increase its color
depth to 24 bits (16 million colors).  So, perhaps there is some way I can
increase the color depth of my BufferedImage in Java before I do the
sharpen operation.

2.  There is something wrong with my sharpen code.  Here it is -

    public void sharpen()
    {
         float[] sharpenArray = { 0, -1, 0, -1, 5, -1, 0, -1, 0 };

         Kernel kernel = new Kernel(3, 3, sharpenArray );
         ConvolveOp cOp = new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP, null);
         imageToDisplay = cOp.filter(imageToDisplay, null );
         imagePanel.setImage( imageToDisplay );
    }


3.  It is not possible to obtain results equal to a professional image editing program 
through the standard Java2D APIs (I hope this is not the case).

Any thoughts on how to improve the sharpen results would be greatly appreciated...

Thanks.

John

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to