Results 1 to 3 of 3
  1. #1
    Zelaine is offline Senior Member
    Join Date
    Aug 2013
    Location
    Sweden
    Posts
    161
    Rep Power
    2

    Default Setting Brightness with RescaleOp

    Hello!

    When I try to brighten my BufferedImages with RescaleOp, they are cut in half, and not brightened at all. However, strangely enough, when I tried to run the same program on another computer they were not cut in half, but only one half of the image was brightened. Here are two images displaying the issue:

    Before brightening:

    Setting Brightness with RescaleOp-before.png

    After brightening:

    Setting Brightness with RescaleOp-after.png

    Why does this happen? Are the images not loaded properly, or am I simply not using the class correctly? Here is my code:

    Java Code:
    ...
    
    RescaleOp op = new RescaleOp(1.2f, 0.0f, null);
    op.filter(enemies.get(y).getImage(), enemies.get(y).getImage());
    
    ...

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    4,026
    Rep Power
    6

    Default Re: Setting Brightness with RescaleOp

    What makes you think that the problem lies in those two lines of code? You said yourself that it works differently on different computers. That could imply different asynchronous activity due to processing speed. You need to submit an Short, Self Contained, Correct Example along with any required images.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    Zelaine is offline Senior Member
    Join Date
    Aug 2013
    Location
    Sweden
    Posts
    161
    Rep Power
    2

    Default Re: Setting Brightness with RescaleOp

    Because when not implementing those two lines, the rendering executes finely. I agree that there could be something else interfering with the image beforehand though, so I will definitely look into that, but still, it is the same part of the image being either brightened or not shown at all depending on which computer I use.

    And about the "Short, Self Contained, Correct Example", I will try to summarize the code even though it consists of quite many classes, neither of which I could see causing the problem. Nevertheless, I will look into it, thanks :)

Similar Threads

  1. RescaleOp problem
    By DiamondSoul in forum Java 2D
    Replies: 0
    Last Post: 10-09-2011, 03:52 AM
  2. Auto contrast and auto brightness
    By oxxxis in forum Java 2D
    Replies: 0
    Last Post: 01-21-2010, 09:32 PM
  3. (Trying to) fill HSB (Hue|Saturation|Brightness) array
    By courteous in forum New To Java
    Replies: 1
    Last Post: 01-19-2009, 08:49 AM
  4. Setting the DSN
    By tim in forum JDBC
    Replies: 1
    Last Post: 02-14-2008, 10:55 PM
  5. Help with setting up please
    By BlitzA in forum New To Java
    Replies: 6
    Last Post: 12-29-2007, 01:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •