Jump to content

vic

Newbies
  • Posts

    6
  • Joined

  • Last visited

vic's Achievements

Rookie

Rookie (2/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. I'm using the images as normal textures. The way OpenGL works is that you upload a texture image to a texture unit, which is then used to map between the coordinates related to the projection of the 3D model on the screen and a color. The coordinates are floating point numbers and they rarely fall on exact pixel centers, so interpolation is used. For example, let's say that the texture is 2x1 pixels, left pixel is RGBA [0.5,0.5,0.5,0], right pixel is [0.5,0.5,0.5,1], and I need to know the color at coordinates (0.5, 0.5) (the center of the image). Interpolation will be done and result in [0.5,0.5,0.5,0.5]. Now if instead left pixel is [0,0,0,0], as Paint.NET would create it, the interpolated intermediary pixel becomes [0.25,0.25,0.25,0.5]. Even though the image looks the same at a 1/1 ratio, when interpolating it is different. The color information is needed here. Strangely GPUs have no concept of color, blending, or even geometry. They are just big number crunchers. Thanks to this discussion I think I now know how to fix the problem (by premultiplying RGB with alpha after having loaded the images). One last thing: in my example in my previous post, if I set the alpha to 1, shouldn't the color information be preserved?
  2. The problem is that I need that color information in the file. OpenGL textures need this for proper rendering. I already tried to set alpha to 1, but the colors are still modified, for example FF9F5B with alpha 1 becomes FFFF00. Oh well, I guess I can't use Paint.NET for my work.
  3. Hi, I'm trying to follow advice given in another thread to preserve the alpha and color information in my images (by saving as PDN instead of PNG), however I'm still having an issue. The steps are : Create an image Use fill tool in overwrite mode with color C0C0C0, alpha = 0 Use the color picker on a pixel : the color is 000000 Is it the intended behavior?
  4. Could you point out where in the standard it says that the RGB values are undefined when alpha is 0? The closest I've found is the section on alpha channel creation : http://www.w3.org/TR/PNG/#12Alpha-channel-creation The use case for preserved colors when alpha=0 is clearly mentioned.
  5. If I set a pixel to some specific value, the program should not change that value. It is not a math issue but a matter of preserving the integrity if the data. This is relevant because in some contexts like OpenGL textures, the color information of pixels is used when resizing even if the alpha channel is zero.
  6. Steps to reproduce : Create a new image Fill it with any non-black color with an alpha channel of zero Save the image as 32 bit PNG Reload the image -> the color is now 000000 instead of the chosen color. Edit: There is also loss of precision of the color with small but non-null alpha values.
×
×
  • Create New...