Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 11-13-2004, 04:46 PM   #1 (permalink)
freesoft_2000
Code Monkey
 
Join Date: Oct 2004
Posts: 51
freesoft_2000 is on a distinguished road
Question Kernel

Hi everyone,

I am trying to use the kernel class to brighten and blur jpeg images but it does not seem to work although the the program compiles without any errors.

Here is the function i use to sharpen my jpeg images

public BufferedImage imagesharper(BufferedImage SourceImage2)
{
BufferedImage Image4 = null;
//i am not ver sure as to whether the calculation values for my kernel
//are correct
float[] k1 = new float[] {
-1,-1,-1,
9,-1,-1,
-1,-1,-1};
Kernel Kernel1 = new Kernel(3, 3, k1);

BufferedImageOp op = new ConvolveOp(Kernel1);
Image4 = op.filter(SourceImage2, null);

return Image4;
}

Here is the function i use to blur my jpeg images

public BufferedImage imageblur(BufferedImage SourceImage5)
{
BufferedImage Image11 = null;
//i am not ver sure as to whether the calculation values for my kernel
//are correct
float[] k2 = new float[] {
1f/9f, 1f/9f, 1f/9f,
1f/9f, 1f/9f, 1f/9f,
1f/9f, 1f/9f, 1f/9f};

Kernel Kernel2 = new Kernel(3, 3, k2);

BufferedImageOp op = new ConvolveOp(Kernel2);
Image11 = op.filter(SourceImage5, null);

return Image11;
}

The program compiles without any errors but when use either the above functions an array index out of bounds exception is thrown.
Could someone see if i am using the kernel class the right way and tell me what i am doing wrong.

Thank You

Yours Sincerely

Richard West
freesoft_2000 is offline   Reply With Quote
Old 11-19-2004, 03:51 PM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,174
Belisarius is on a distinguished road
Can you tell from the stacktrace where the exception is occuring in your code? I've never used Kernel before, so I can't spot anything in particular wrong.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 11-20-2004, 02:03 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,530
sde is on a distinguished road
he has posted a new questions without acknowleging this response ..

freesoft, please respond so we know you're not a bot. i notice the same posts on other forums too.
__________________
Mike
sde is offline   Reply With Quote
Old 11-20-2004, 09:15 PM   #4 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,174
Belisarius is on a distinguished road
He has responded previously, but rarely.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 11-21-2004, 01:06 AM   #5 (permalink)
freesoft_2000
Code Monkey
 
Join Date: Oct 2004
Posts: 51
freesoft_2000 is on a distinguished road
Hi everyone,

No i am not a robot, so sorry to take so long to respond as i was quite busy. i apologize.

Anyways i tried looking around and it seems that my code is perfect. The problem seems is that jpeg format images cannot recognize transparency. This is what i know so far but i am still trying to comfirm it.

Now i am trying to add hyperlinks into the jtextpane using its default html document class which is my latest post and maybe someone can help me with that.

By the way this is really constructive forum

Yours Sincerely

Richard West
freesoft_2000 is offline   Reply With Quote
Old 11-21-2004, 07:59 AM   #6 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,174
Belisarius is on a distinguished road
Hey, no problem. I'm just sorry I can't be more helpful, as the graphical libraries aren't my strong-point in Java.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 11-21-2004, 09:42 AM   #7 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,530
sde is on a distinguished road
Quote:
Originally Posted by freesoft_2000
jpeg format images cannot recognize transparency. This is what i know so far but i am still trying to comfirm it.
Hi Richard, .. that is definately true. jpeg does not support transparency.

i was just a bit paranoid about bots and spammers because we've had problems in the past. thanks for checkin in =)

good luck
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
installing new kernel pe666o Linux / BSD / OS X 2 05-09-2004 11:52 PM
A critical security vulnerability has been found in the Linux kernel redhead Code Newbie News 0 02-19-2004 11:37 PM
Red Hat Linux Advisory: kernel sde Code Newbie News 0 02-18-2004 03:11 PM
LinuxWorld: 2.6 kernel cures some security shortcomings sde Code Newbie News 0 08-08-2003 08:39 AM
Database Users Keen on Linux 2.6 Kernel sde Linux / BSD / OS X 0 05-19-2003 03:01 PM


All times are GMT -8. The time now is 01:26 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting