From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <9ab217670903041422t27ffc464j46b9ac1c2a976c06@mail.gmail.com> References: <14ec7b180903041337t1b2f9712v20e13a7d40ba52ed@mail.gmail.com> <86a482e98e3cc74a84d531d3018176e8@coraid.com> <14ec7b180903041353o66f0c658reac4d357a508d10e@mail.gmail.com> <972ce83315a8e104ce34f039aaa2bfc6@coraid.com> <9ab217670903041422t27ffc464j46b9ac1c2a976c06@mail.gmail.com> Date: Wed, 4 Mar 2009 15:45:33 -0700 Message-ID: <14ec7b180903041445n3d85c298g911c825fca617d78@mail.gmail.com> From: andrey mirtchovski To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Porter-Duff alpha blending Topicbox-Message-UUID: b26e767c-ead4-11e9-9d60-3106f5b1d025 Erik, I think you're running in 32bpp mode, right? To have 'png' render RGB24.png correctly make the following change to /sys/src/cmd/jpg/png.c: % yesterday -d png.c diff /n/dump/2009/0304/sys/src/cmd/jpg/png.c /sys/src/cmd/jpg/png.c 139c139 < Image *i, *i2; --- > Image *i, *i2, *i3; 205c205,207 < image = i2; --- > i3 = allocimage(display, c->r, RGB24, 0, 0); > draw(i3, i2->r, i2, nil, i->r.min); > image = i3; what this does is "filter" thr 32-bit alpha blended original through a 24-bit RGB image. this circumvents the bug by avoiding the conversion from 32-bit image to a 32-bit display. alternatively, you can try going down to 24bpp. i am not competent to dig through the parts of memdraw in order to fix this, so i won't offer to do it :)