Hi,
lately I wrote an "edge-smoothing" method. I didn't like to have such sharp color changes where you can see each pixel (e.g. after drawing a circle or a line which isn't horizontal or vertical). (This method is the main reason for saving images at the beginning and getting the java heap size error a few days ago.)
Now my problem is, that if a pixel in the original picture was transparent, then this pixel will be handled as completely black (getRed(), getGreen() and getBlue() return 0).
This never seem to return 0. Even if I create a new GreenfootImage (which is transparent by default).
If it would, I could just skip all transparent pixels, so after the modification, they will still be transparent.
Could it be, that the returned color from 'getColorAt' doesn't support transparency?
I also tried 'getAlpha' instead of 'getTransparency'. This returns 0 for every pixel of a new transparent GreenfootImage, but somehow not for a transparent (but not empty) part of an image. (Well, but actually I have no idea about the difference between Alpha and Transparency.)
Is there a way to find out the transparency of a certain pixel of an image?
And if yes, is there a way to find out the rgb-values of a transparent pixel?
1 | image.getColorAt(x,y).getTransparency(); |