Reputation: 16 Tradesman
- Active Posts:
- 281 (0.12 per day)
- 27-February 08
- Profile Views:
- Last Active:
- Dec 18 2013 02:36 PM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Who Cares
- Dream Kudos:
Posts I've Made
Posted 11 Feb 2013I 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.
Posted 10 Feb 2013What 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?
- Member Title:
- D.I.C Regular
- Age Unknown
- Birthday Unknown
- Programming random (most of the time useless) apps. And watching TV and the usual what nots
- Years Programming:
- Programming Languages:
- C#,C++(very little),Java,Visual Basic,Action Script(a bit), and lots and lots of Autoit
- Website URL:
painkiller102 hasn't added any friends yet.