One more quick note:

The quartz image loader now automatically loads in images with
premultiplied alpha by default.  There doesn't seem to be any easy way
around this.  So this means that you should use the correct blending
function for premultiplied alpha, which is

glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)

or if using the sprite module, set your sprite's blend_src to GL_ONE.

Otherwise, you'll end up with dark fringes around your images.

--phillip


On Mar 17, 12:40 am, Phillip Nguyen <[email protected]> wrote:
> I just pushed a change which I think fixes this in the trunk.  I
> formerly had been trying to be clever about dealing with different
> data formats and it seems like it backfired.  So now image data is
> loaded in as RGBA regardless of its original format, which I think
> more closely agrees with what the other platforms do.  The upshot is
> that indexed color PNGs should now load properly and I think some
> other issues were cleared up as well.
>
> --phillip
>
> On Mar 16, 11:05 am, Nathan <[email protected]> wrote:
>
>
>
>
>
>
>
> > I have run into that same problem on OS X!  8-bit PNG files come out
> > wildly distorted color-wise (in my case, a picture with muted colors
> > came out in bright blues).  I just figured 8-bit PNG wasn't supported
> > and switched to 24-bit, though the file sizes tend to be larger.
>
> > ~ Nathan
>
> > On Thu, Mar 15, 2012 at 4:18 PM, Phillip Nguyen <[email protected]> 
> > wrote:
> > > I think this is probably a bug in pyglet's quartz image decoder having
> > > to do with loading color-indexed PNGs.
>
> > > --phillip
>
> > > On Mar 15, 4:16 pm, Charles Brandt <[email protected]> wrote:
> > >> I've been using pyglet trunk (1.2 dev) on a Mac with OS X version 10.6.8
> > >> and Python version 2.6.1.  Generally, things seem to be working very
> > >> well with the Cocoa version of pyglet.
>
> > >> I have noticed one strange behavior when trying to display a PNG file.
> > >> For example, using the following image:http://i.imgur.com/65CT3.png
>
> > >> With:
> > >> python pyglet/examples/image_display.py 65CT3.png
>
> > >> results in a very dim version of the image being displayed.  It almost
> > >> looks like a black image with nothing there, but the original version is
> > >> faintly visible.  It seems to be specific to the PNG format (maybe a
> > >> transparency issue?), since a JPG version of the image shows up no
> > >> problem.  Also, I have tried the same PNG on other back ends with pyglet
> > >> (windows, etc) and the image shows up as expected.
>
> > >> Any ideas?
>
> > >> Thanks!
>
> > >> -Charles.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "pyglet-users" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to 
> > > [email protected].
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/pyglet-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to