Search:

Type: Posts; User: sjdganc

Search: Search took 0.10 seconds.

  1. Re: Convert color image to grayscale and then to sepia

    I'm stumped. Am I on the right track with the below code? Or do I need to redefine red, green, and blue?



    if(red < 63) {
    red = (int)(red * 1.1);
    blue = (int)(blue...
  2. Re: Convert color image to grayscale and then to sepia

    I put the {} around the for statements but the outcome did not change. Still only getting the color image.



    for(int y = 0; y < image.getHeight(); y++) {
    for(int x = 0; x <...
  3. Re: Convert color image to grayscale and then to sepia

    I found the error, it was the curly brace, ugh. So the program is compiling without errors but not doing what I want it to do. Now only the color image displays. The grayscale image is not showing...
  4. Re: Convert color image to grayscale and then to sepia

    Yes I'm sure but now I'm having trouble recreating it. I keep getting an illegal start of statement at line 56 which is the curly brace right above the comment //Causes program to wait to draw the...
  5. Re: Convert color image to grayscale and then to sepia

    Just saw your update. I put the for loop in just to see the pixel values. So I'll try putting it after the if () statements and get the values.

    --- Update ---

    So here is the whole code. I put...
  6. Re: Convert color image to grayscale and then to sepia

    Ok. That makes sense. What is printing out as the pixel values follows the if statements, so maybe what I am missing is the code after the if() statements to get or set what the pixels should be. Is...
  7. Re: Convert color image to grayscale and then to sepia

    I put in a for statement to run through all of the pixels. The red pixel is below 63 and when I run it through the second if statement they are below 192.



    if(red < 63) {
    red = (int)(red...
  8. Re: Convert color image to grayscale and then to sepia

    I put in a println() statement and the values are all the same:
    Pixel R: 62 G: 62 B: 62

    which is the grayscale. So according to this the R value is less than 63 as in the below if statement. The...
  9. Re: Convert color image to grayscale and then to sepia

    Hmmm. I'm not sure how to do that. I'll keep researching.
  10. Re: Convert color image to grayscale and then to sepia

    I thought the second if statement and elseif statements is the code for sepia.
  11. Re: Convert color image to grayscale and then to sepia

    Thank you that cleared the errors. So now the image appears in color and then in grayscale but the sepia effect is not working. What am I missing?
  12. Convert color image to grayscale and then to sepia

    I have the program working where the image is converted to grayscale but I get the following error when trying to convert from grayscale to sepia.

    java:36 error: '. class' expected
    red =...
Results 1 to 12 of 12