Dare I even ask why people are writing PNG files from Nuke? It's not exactly a
VFX-friendly file format.
You can force some kind of conversion with oiiotool. If you have a file that
saves as PNG but that somehow you know is already premultiplied, you could try
"oiiotool --no-autopremult in.png -o outputfile.ext" to suppress the
premultiplication that would ordinarily happen when reading PNG files, then
write to a new file.
-- lg
On Jul 24, 2014, at 8:50 PM, Jonathan Gibbs <[email protected]> wrote:
> Nuke assumes associated alpha all over the place, no? I don't see why it
> doesn't also assume associated alpha when it's writes PNG files so it can
> write correct ones.
>
> But you are right, if you assume that Nuke doesn't know if alpha is
> associated or not, and some nodes assumes it's not and some assume that it
> is, then the situation can't really be improved other than perhaps a option
> on the file writer to make it more obvious.
>
> --jono
>
>
>
> On Thu, Jul 24, 2014 at 5:02 PM, Rangi Sutton <[email protected]>
> wrote:
> Hey Jono,
>
> So, if you're working with un-premultiplied alpha in your scripts then you
> would need to put down a pre-multiply node before writing out you're pngs.
> Which is counter intuitive and potentially lossy.
>
> Which one is it? Should nuke guess? Or should it just do what it's told.. ie,
> write the colour values it's given. I like that it does what it's told.
>
> Cheers,
> r.
>
>
> Rangi Sutton
> VFX Supervisor
> Cutting Edge
>
>
> On 25 July 2014 09:38, Jonathan Gibbs <[email protected]> wrote:
> Well, that's pretty unfriendly on Nuke's part. PNG is pretty clear what is
> and isn't supposed to be in the file.
> --jono
>
>
>
> On Thu, Jul 24, 2014 at 3:46 PM, Rangi Sutton <[email protected]>
> wrote:
> Hey,
>
> I think it's a good thing Nuke doesn't try and second guess you and make
> "intelligent" decisions about what you're trying to achieve. For this case,
> if the nuke script contains pre-mulitplied alpha, then un-premultiply it
> (divide by alpha) before writing out your png files.
>
> Unless I'm missing something!
>
> Cheers,
> r.
>
>
>
> Rangi Sutton
> VFX Supervisor
> Cutting Edge
>
>
> On 25 July 2014 04:32, Mikael Sundell <[email protected]> wrote:
> Aaaargggh :-)
>
> Skickat från min iPhone
>
> 24 Jul 2014 kl. 19:49 skrev Larry Gritz <[email protected]>:
>
>> The fun with PNG never seems to end. And by "fun", I mean a hot poker in
>> the eye.
>>
>>
>> On Jul 24, 2014, at 1:20 PM, Mikael Sundell <[email protected]> wrote:
>>
>>> I seems as if Nuke writes data with associated alpha in PNG files,
>>> according to the spec it's not valid:
>>>
>>> http://www.libpng.org/pub/png/spec/1.2/PNG-DataRep.html
>>>
>>> "The color values stored for a pixel are not affected by the alpha value
>>> assigned to the pixel. This rule is sometimes called "unassociated" or
>>> "non-premultiplied" alpha. (Another common technique is to store sample
>>> values premultiplied by the alpha fraction; in effect, such an image is
>>> already composited against a black background. PNG does not use
>>> premultiplied alpha.)"
>>>
>>> This causes the PNGReader to associateAlpha(…) on already alpha multiplied
>>> data. Did anyone else experience this problem?
>>>
>>> Mikael
>>
>> --
>> Larry Gritz
>> [email protected]
>>
>
>
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>
>
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
--
Larry Gritz
[email protected]
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org