Search:

Type: Posts; User: Norm

Search: Search took 0.33 seconds.

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

    What is the for loop at the end of the posted code supposed to do?
    The values of red and blue do not change in the loop.
    What will the image look like if all the pixels are set to the same values...
  2. Re: Convert color image to grayscale and then to sepia

    Nothing is changed inside that loop. The set methods are called with the same values everytime around the loop.


    Only one. The inner one isn't in {}s
    But that makes no difference. The loop is...
  3. Re: Convert color image to grayscale and then to sepia

    The for statements are missing {}s that should enclose the code that is inside of the loop. Never leave off the {}s. Indenting a statement does NOT put it inside of a for loop. Use {}s

    This for...
  4. Re: Convert color image to grayscale and then to sepia

    Please copy the full text of the error message and paste it here and the full java code that has the errors.
  5. Re: Convert color image to grayscale and then to sepia

    The variable: red is defined 3 statements before that statement in the posted code.
    Are you sure you posted the code with the error?


    int red = p.getRed(); //<<<<<<< Defined...
  6. Re: Convert color image to grayscale and then to sepia

    I think the code should use the new values to change the image.
  7. Re: Convert color image to grayscale and then to sepia

    Is that what they are supposed to be? Is the code doing what you expect? If not, explain what it is not doing correctly.

    The for loop is inside the if() test for red < 63. Why is there a loop...
  8. Re: Convert color image to grayscale and then to sepia

    Add some more println() statements so you can see what statements are being executed and what the values of the variables are as they are changed. The code in post#9 doesn't have any print...
  9. Re: Convert color image to grayscale and then to sepia

    One debugging technique is to use println() statements to print out the values of variables as they are used and changed.
  10. Re: Convert color image to grayscale and then to sepia

    Is the results from when those statements correct? Have you tried debugging the code to see if the values are right?
  11. Re: Convert color image to grayscale and then to sepia

    Do you have the coding rules for creating those kinds of images? Does your code follow those rules?
  12. Re: Convert color image to grayscale and then to sepia

    int is coded here with method call syntax.
    int is a keyword and can't be the name of a method.
    Casting is done by enclosing the type in ()s: (int)
    You have several correct casts:
    red =...
Results 1 to 12 of 12