[android-developers] Re: question about blending bitmaps (Porterduff? matrix?)
Adding to the original question: along with which is the best method
for results, add to that the need to minimize usage of memory. I am,
of course, recycling all bitmaps one line after I'm finished with them
(there aren't many, but they are quite large). I really want to give the
user the full resolution that their camera offers while still applying
the filters and other effects.
Also, should I, perhaps, have posted this in the android-for-beginners
group?
On Wed, Apr 11, 2012 at 03:24:40PM -0500, Jim Graham wrote:
> I'm looking for the best way to combine/blend two (or more) solid-color
> bitmap so the colors are combined. The bitmaps have one color with an
> alpha value of 102 for solid color bitmaps, 102 and decreasing to 0 at
> about 48% of the bitmap's height (from either the top or bottom) for
> graduated color bitmaps, and for split-field, the same, except not a
> gradual change---just 102 then 0 at 50%.
Those alpha values may be wrong, btw. I'm still doing some testing to
get the levels that match the "real thing" (film + glass).
> By blending, what I mean is this: Imagine that you have two sheets
> of colored plastic. You look through one of them, and you see its
> color over the scene behind it. You then add the second sheet of
> a different color clear plastic, and now you see the two colors
> interacting to make a new color. That is what I'm trying to do.
>
> In the case of graduated or split-field, the transparent area should
> not interfere with a second filter's color where it is colored in
> the transparent area of another.
>
> Btw, all of these bitmaps are created as needed using
> Bitmap.createBitmap (ARGB_8888), paint, and drawing on the canvas.
> I was using 60x40 png files for the solid colors, but the transparent
> white background ended up not being so transparent.... Now I just
> create larger bitmaps with NO background---just color (alpha 102) or
> completely transparent.
>
> What would be the best way to do this? If Porterduff, which mode?
> Or would some type of matrix calculation be better? Or is there
> another way that I haven't come across yet?
>
> (If the best way calls for a matrix, a pointer to a good matrix tutorial
> would be really helpful.)
>
> Thanks,
> --jim
>
> --
> THE SCORE: ME: 2 CANCER: 0
> 73 DE N5IAL (/4) | DMR: So fsck was originally called
> spooky130u@gmail.com | something else.
> < Running FreeBSD 7.0 > | Q: What was it called?
> ICBM / Hurricane: | DMR: Well, the second letter was different.
> 30.44406N 86.59909W | -- Dennis M. Ritchie, Usenix, June 1998.
>
> Android Apps Listing at http://www.jstrack.org/barcodes.html
--
THE SCORE: ME: 2 CANCER: 0
73 DE N5IAL (/4) | "My spell checker eloped with a wiccan
spooky130u@gmail.com | and I've not seen it since!"
< Running FreeBSD 7.0 > |
ICBM / Hurricane: | (from news.admin.net-abuse.email)
30.44406N 86.59909W |
Android Apps Listing at http://www.jstrack.org/barcodes.html
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home