- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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?
링크가 복사됨
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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
