I see, so it's the ImageSurface part.<br><br>I've been fighting this issue for a week now. I started out with GDI+, and now Cairo, both of which have the same underlying problem (from what I understand from what you're telling me): floating point pixel data.<br>
<br>Are there no other surfaces in Cairo's arsenal that I can use here? I see a lot of other stuff like Xlib, Glitz, Xcb, does any of this give me anything I could work with perhaps?<br><br>I'd look at GIMP but with such a large project I'm not exactly sure where I'd look. There has to be something available to me that supports what I'm looking to do..<br>
<br><div class="gmail_quote">On Fri, Nov 12, 2010 at 7:23 AM, Andrea Canciani <span dir="ltr"><<a href="mailto:ranma42@gmail.com">ranma42@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Fri, Nov 12, 2010 at 12:54 PM, Paril <<a href="mailto:paril@alteredsoftworks.com">paril@alteredsoftworks.com</a>> wrote:<br>
> The black halo isn't black in a colored image, I was talking about in the<br>
> white image, which I understand because of how premultiplication works (1 1<br>
> 1 1 * 1 1 1 0.5 = 0.5 0.5 0.5 0.5); with the different colors it changes<br>
> around, but yes, you are right, it's more like a multicolored halo.<br>
><br>
> I get what you mean with the error accumulation, but what else can I do<br>
> here? There's no Cairo function, that I can tell, to use SetSourceColor when<br>
> SetSource on a pattern is used, hence why I do the color stuff manually, and<br>
> I still have to multiply the values to get the bitmap together for Cairo to<br>
> use properly. The _fixed.txt you had attached before seemed to just lighten<br>
> the transparency and make it less visible, but the streaks are still<br>
> definitely there.<br>
><br>
> Your explanation of errors makes complete sense to me because when I look at<br>
> it, the streaks barely occur when the color values are 0, 0.5 or 1; any<br>
> value in-between and you can see the streaks on a huge scale, but with those<br>
> three values you see maybe one or two points off the color.<br>
><br>
> Cairo only supports integral colors, so there will be rounding errors with<br>
> all of this multiplication... do you have any ideas on what I can do?<br>
<br>
</div>Actually cairo supports floating points colors, but the image backend (which<br>
composites images using pixman) restricts you to integers. In theory it would<br>
be possible to use floating point formats (for example on macosx you could<br>
create a cairo-quartz surface that stores color information in floats).<br>
<br>
I'm currently working on supporting colorspaces in cairo and pixman<br>
and a side-project<br>
includes extending the supported formats, but right now my code is experimental<br>
(and, at least in some parts, broken) and will anyway take some time<br>
to get it into<br>
the projects, so I guess that relying on cairo support for floating<br>
point compositing<br>
is not an option right now.<br>
<br>
I think that (unless you are willing to do the compositing yourself),<br>
you might want to<br>
look at how gimp (or some other open source project) handles this issue.<br>
<font color="#888888"><br>
Andrea<br>
</font></blockquote></div><br>