- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Is there an inverse to the AlphaPremul method?
Based on the thread here, it seems that AlphaComp always produces pre-multiplied results. If I want to save those results to PNG, I have to un-premultiply them. I dont see an inverse to the AlphaPremul method. Is there some other way of un-premultiplying an image, or so I have to write it by hand?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi David,
I am afraid we do not have, you probably could consider implemented by self. If you use AlphaPremul that means you already get Cr|g|b= Ar|g|b * αA , (αA=αC) and you would like to get RGB value of A, you could calculate by Cr|g|b*1/αC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Maybe you can consider this an addition for the future. Since you already have optimized code for doing the premul, it should be really easy do 1/alpha at the same time. Of course I can do it myself, but it likely will not be as optimized as the code you have for premul.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you tried ippsDiv?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We did not try that. Do you think that one of the div functions will help in this case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yesterday I checked that ippiMul and ippiAlphaPremul are equivalent and remembered this thread, so ippiDiv should work with the caveat that it won't support the alpha packed with the RGB. You would need separate planes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ippiDiv has the problem of division by zero (returning an warning error code for u and s integer types and producing NAN_32F, INF_32F or INF_NEG_32F values for floating-point types). So, I do feel that AlphaUnPremul functions are missing. For example, Apple's vImage library has vImageUnpremultiplyData functions for the purpose.
Regards,
Adriaan van Os

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page