Hi Larry!

Apologize for the lack of response.

Inspecting the values indeed show variations in the alpha channel, so it
works and this turns out to be a case of misconception from my side.
I assumed that render_text would do an "over" and that by setting alpha of
text color to values below 1 would yield "see through" text rather than
directly manipulating the pixels in the buffer.

Thank you for your help!



On Tue, May 25, 2021 at 9:31 PM Larry Gritz <l...@larrygritz.com> wrote:

> Sorry, of course I meant (1+0.6*something). The 0.4 is opacity, not
> transparency.
>
> A over B = A + (1-A.alpha)*B
>
>
> On May 25, 2021, at 12:30 PM, Larry Gritz <l...@larrygritz.com> wrote:
>
> Well, you have set the text color to (1,1,1,0.4), so if you put that
> "over" an image, then write to (or display on) a LDR device or file, the
> resulting "clamp" to the full intensity of the output will not be
> distinguishable from if it were opaque. But if you are inspecting values in
> an HDR format like OpenEXR, then the values of text (1,1,1,0.4) over
> "something" will be (1+0.4*something, ...), whereas opaque (1,1,1,1) over
> "something" will be exactly (1.0, ...) no matter what the something is.
> Note that for both of those, if clamped to a max of 1.0, they will look the
> same.
>
>
> On May 25, 2021, at 12:18 PM, Daniel Flehner Heen <flehnerhee...@gmail.com>
> wrote:
>
> Hmmm. I've only checked visually, but when rendering on an image I can't
> see through the text. If you get transparency I must be doing
> something wrong.
> I'm not in front of a computer at the moment, but I'll try and break down
> my process and see if I can figure it out.
> I'll let you know what I find.
>
> Thanks,
>
>
>
>
>
> On Tue, May 25, 2021, 21:01 Larry Gritz <l...@larrygritz.com> wrote:
>
>> Works for me. How are you determining that there is "no difference in
>> transparency"? Are you inspecting the alpha values in the output file? Are
>> you compositing on top of something?
>>
>>
>> On May 25, 2021, at 11:58 AM, Daniel Flehner Heen <
>> flehnerhee...@gmail.com> wrote:
>>
>> Sorry, should have been more specific.
>> There seems to be no difference in the text's transparency for values
>> between 0.1 and 1.0 for the alpha channel.
>>
>> On Tue, May 25, 2021, 20:48 Larry Gritz <l...@larrygritz.com> wrote:
>>
>>> What happens, specifically?
>>>
>>>
>>> On May 25, 2021, at 6:31 AM, Daniel Flehner Heen <
>>> flehnerhee...@gmail.com> wrote:
>>>
>>> Hi!
>>>
>>> I'm attempting to render text with 40% opacity in python without
>>> success. OIIO 2.2.10.1
>>>
>>> ``` python
>>> import OpenImageIO as oiio
>>> buf = oiio.ImageBuf(oiio.ImageSpec(640, 480, 4 oiio.FLOAT))
>>> oiio.ImageBufAlgo.render_text(buf, 100, 200, "Hello, World!", 60,
>>> "FreeSans", (1, 1, 1, 0.4))
>>> buf.write('transparent_text_test.exr')
>>> ```
>>>
>>> Am I doing something wrong?
>>> Any pointers would be greatly appreciated.
>>>
>>> Thanks,
>>>
>>> --
>>> -Daniel
>>> _______________________________________________
>>> Oiio-dev mailing list
>>> Oiio-dev@lists.openimageio.org
>>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>>>
>>>
>>> --
>>> Larry Gritz
>>> l...@larrygritz.com
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Oiio-dev mailing list
>>> Oiio-dev@lists.openimageio.org
>>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>>>
>> _______________________________________________
>> Oiio-dev mailing list
>> Oiio-dev@lists.openimageio.org
>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>>
>>
>> --
>> Larry Gritz
>> l...@larrygritz.com
>>
>>
>>
>>
>> _______________________________________________
>> Oiio-dev mailing list
>> Oiio-dev@lists.openimageio.org
>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>>
> _______________________________________________
> Oiio-dev mailing list
> Oiio-dev@lists.openimageio.org
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>
>
> --
> Larry Gritz
> l...@larrygritz.com
>
>
>
>
>
> --
> Larry Gritz
> l...@larrygritz.com
>
>
>
>
> _______________________________________________
> Oiio-dev mailing list
> Oiio-dev@lists.openimageio.org
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>


-- 
-Daniel
_______________________________________________
Oiio-dev mailing list
Oiio-dev@lists.openimageio.org
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to