painkiller102's Profile User Rating: -----

Reputation: 15 Tradesman
Group:
Contributors
Active Posts:
281 (0.12 per day)
Joined:
27-February 08
Profile Views:
5,870
Last Active:
User is offline Dec 18 2013 02:36 PM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
50

Latest Visitors

Icon   painkiller102 has not set their status

Posts I've Made

  1. In Topic: problem reading colors from a bufferedimage

    Posted 11 Feb 2013

    View Postpbl, on 11 February 2013 - 11:51 AM, said:

    View Postpainkiller102, on 11 February 2013 - 12:52 AM, said:

    I wish there was a way to be able to pull out exactly what was drawn to the image to begin with.

    If you knew the original Image background may be a brute force algorithm may achieve that but the problem is false, in the sense that I can't figure out an application that would require such and editing, to start with.


    Well it was going to be used as part of an eye dropper tool. So the user can select the pixel and then re-draw it with the same color and alpha value. I can always change it to take a sub-image and then re-draw that image where the user selects, but that is more of a workaround to what i was wanting, but still it will work.
  2. In Topic: problem reading colors from a bufferedimage

    Posted 10 Feb 2013

    View Postpbl, on 10 February 2013 - 02:40 AM, said:

    What let you think so ?
    The BufferedImage method getRGB(int x, int y) is probably one of the Image easiest method to use.
    So what is the actual outputed values and the expected one ?

    The use of Alpha will screw up your read back as it will be mixed with the default background color

    An Alpha of 100 will bring more accurate results


    yea that was what i was afraid of. I wanted to pull out accurate information for each pixel, but sense the user can change the pixels alpha value, this creates the accuracy problem. The values are commonly only 1-5 off of the original color. I wish there was a way to be able to pull out exactly what was drawn to the image to begin with. The only way i can think of doing it is to log the colors themselves in an array but that's obviously going to lead to a bigger file size when i saved a serialized class with them all.

    Just as an edit, i have played around with transparency a bit more in a professional image editing program. It would seem if i can get rid of the alpha value somehow the original RGB values would be restored. In an image editing program, i would just continue to draw the transparent pixel over and over again until it was solid. In my case however, i cannot just do:

    BufferedImage drawOver = new BufferedImage(50,50,BufferedImage.TYPE_INT_ARGB);
            g = drawOver.getGraphics();
            color1 = new Color(img.getRGB(0, 0),true);
            g.setColor(color1);
            g.fillRect(0, 0, 50, 50);
            g.fillRect(0, 0, 50, 50);
            g.fillRect(0, 0, 50, 50);
            g.fillRect(0, 0, 50, 50);
            g.fillRect(0, 0, 50, 50);
            g.fillRect(0, 0, 50, 50);
    
    


    to fix the issue. All this does is replace the old pixel with the new one, and doesn't actually re-draw the pixel over the first one. Is there a way for me to re-draw pixels instead of just replacing them?

My Information

Member Title:
D.I.C Regular
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Interests:
Programming random (most of the time useless) apps. And watching TV and the usual what nots
Years Programming:
3
Programming Languages:
C#,C++(very little),Java,Visual Basic,Action Script(a bit), and lots and lots of Autoit

Contact Information

E-mail:
Private
Website URL:
Website URL  http://

Friends

painkiller102 hasn't added any friends yet.

Comments

painkiller102 has no profile comments yet. Why not say hello?