?
Solved

Image Manipulation Filter

Posted on 2003-03-11
9
Medium Priority
?
191 Views
Last Modified: 2009-12-16
I want to manipulate an image--pixel by pixel--so that when I apply the filter to the image, the resulting image is different from the original.

For one filter, I want to create a watercolor effect to the image. For another, I want to greyscale the image. However, I don't really know how to do either....

I have something like this:

public class EffectFilter implements Filter {
 
  public void filter(PixelImage pi) {
    Pixel[][] data = pi.getData();
   
    for (int row = 0; row < pi.getWidth(); row++) {
      for (int col = 0; col < pi.getHeight(); col++) {
        /** Create an effect for every pixel of the image */
      }
    }
  }
   
This is for an intro java programming class, so I'm a beginner.

Any help appreciated. Thanks!

0
Comment
Question by:Yoohoo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 8

Expert Comment

by:akshayxx
ID: 8116681
Hi Yoohoo,
Water color effect will require lot of mathemetics,
though converting to gray scale is pretty stright forward.
take the R, G, B values and take the 'average' and then set each of the R,G,B to the average value..
many people dont take just simple average .. rather a weighted average .. but the key is that whatever calculation you do .. set the newpixel.R=newpixel.G=newpixel.B=new average value
if u take simple arithmetic mean .. it will also give decent result..
and when u r done with changing the pixel values .. save it to the new image.. ( create the new Image with new pixel values)
and for the water color effect . .. check google for the mathemetical operations required for that.

Cheers!
0
 

Author Comment

by:Yoohoo
ID: 8116815
I'm confused with 'newpixel'. What is that?
0
 

Author Comment

by:Yoohoo
ID: 8116856
I'm confused with 'newpixel'. What is that?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 8

Accepted Solution

by:
akshayxx earned 100 total points
ID: 8116857
well new pixel is nothing but another pixel array ,
in your case
Pixel[][] newpixel;
this i wud recommend, if u want to keep ur original image intact.
so make save the changes to this new pixel array , and make new image out of it..

0
 
LVL 92

Assisted Solution

by:objects
objects earned 100 total points
ID: 8117001
Java already provides classes for filtering images.
Here's an example:

http://javaalmanac.com/egs/java.awt.image/FilterRgb.html
0
 

Expert Comment

by:CleanupPing
ID: 9058758
Yoohoo:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 8

Expert Comment

by:akshayxx
ID: 9063772
split  betwn me and objects
0
 
LVL 35

Expert Comment

by:girionis
ID: 9714297
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Split points between akshayxx and objects

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question