Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By jasonw749

Thread: Image Color Problem

  1. #1
    jasonw749 is offline Member
    Join Date
    Mar 2012
    Posts
    9
    Rep Power
    0

    Default Image Color Problem

    hi, i made this image in paint.net
    Image Color Problem-background-trial.png

    but when i load it up in java it appears like this
    Image Color Problem-failed-image.png

    any help on this matter would be greatly appreciated, thanks a lot

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: Image Color Problem

    What code are you using to "load it up in Java"? And what differences do you see in the images as they appear the same to me.

  3. #3
    jasonw749 is offline Member
    Join Date
    Mar 2012
    Posts
    9
    Rep Power
    0

    Default Re: Image Color Problem

    Quote Originally Posted by Fubarable View Post
    What code are you using to "load it up in Java"? And what differences do you see in the images as they appear the same to me.
    public void paint(Graphics g){
    if(loaded){
    g.drawImage(back, 0, 0, null);
    }
    }

    and if you click on the pictures to see the higher resolution the second ones colors dont mix together as well its difficult to explain

    erm.. if you cant tell the difference maybe its not as big of a problem as i thought. click on em and see if you can see the difference in higher resolution

  4. #4
    jasonw749 is offline Member
    Join Date
    Mar 2012
    Posts
    9
    Rep Power
    0

    Default Re: Image Color Problem

    the problem was the amount of colors i let java use, i just doubled it and now everything is fine :)
    Fubarable likes this.

  5. #5
    natdizzle's Avatar
    natdizzle is offline Nathan Nelson
    Join Date
    Jan 2009
    Posts
    105
    Rep Power
    0

    Default Re: Image Color Problem

    did you "super.paintComponent(g)"? i know images show up less good if you dont

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Image Color Problem

    Quote Originally Posted by natdizzle View Post
    did you "super.paintComponent(g)"? i know images show up less good if you dont
    Only if the images have transparency.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. extracting color from an image in java
    By sarah49 in forum New To Java
    Replies: 4
    Last Post: 09-18-2012, 03:22 PM
  2. scanning an image for a certain pixel color
    By lostsoul28 in forum New To Java
    Replies: 1
    Last Post: 02-01-2012, 02:50 PM
  3. Replies: 4
    Last Post: 11-08-2011, 06:04 AM
  4. Changing Image color
    By Frecow in forum Java 2D
    Replies: 0
    Last Post: 04-04-2011, 11:16 AM
  5. SWT color creating and image using.
    By caryr in forum SWT / JFace
    Replies: 2
    Last Post: 12-21-2009, 06:49 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
  •