9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: andrey mirtchovski <mirtchovski@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Porter-Duff alpha blending
Date: Wed,  4 Mar 2009 15:45:33 -0700	[thread overview]
Message-ID: <14ec7b180903041445n3d85c298g911c825fca617d78@mail.gmail.com> (raw)
In-Reply-To: <9ab217670903041422t27ffc464j46b9ac1c2a976c06@mail.gmail.com>

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 :)



  reply	other threads:[~2009-03-04 22:45 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04 21:32 erik quanstrom
2009-03-04 21:37 ` andrey mirtchovski
2009-03-04 21:42   ` andrey mirtchovski
2009-03-04 21:44   ` erik quanstrom
2009-03-04 21:53     ` andrey mirtchovski
2009-03-04 22:03       ` erik quanstrom
2009-03-04 22:21         ` andrey mirtchovski
2009-03-04 22:22         ` Devon H. O'Dell
2009-03-04 22:45           ` andrey mirtchovski [this message]
2009-03-04 22:59             ` erik quanstrom
2009-03-04 23:05               ` andrey mirtchovski
2009-03-04 23:58             ` Charles Forsyth
2009-03-05  1:04               ` erik quanstrom
2009-03-05  1:29               ` andrey mirtchovski
2009-03-05  2:07                 ` andrey mirtchovski
2009-03-05  2:22                   ` erik quanstrom
2009-03-06  3:21                     ` andrey mirtchovski
2009-03-06 20:48                       ` Russ Cox
2009-03-06 21:42                         ` andrey mirtchovski
2009-03-08 22:33                           ` Jeff Sickel
2009-03-09 15:28                             ` Michaelian Ennis
2009-03-09 16:40                               ` Jeff Sickel
2009-03-09 14:00                         ` erik quanstrom
2009-03-09 15:32                           ` yy
2009-03-04 21:53 erik quanstrom
2009-03-04 22:01 ` andrey mirtchovski
2009-03-05 18:31 maht
2009-03-04 21:18 ` andrey mirtchovski
2009-03-04 23:24 ` Russ Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14ec7b180903041445n3d85c298g911c825fca617d78@mail.gmail.com \
    --to=mirtchovski@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).