Page 1 of 1

tv_saveDisplay with alpha

Posted: 06 Sep 2013, 13:51
by Mads Juul
Is it possible to use tv_saveDisplay and keep and alpha channel where the display is Transparent.

Code: Select all

tv_getPath TEMP
	myFile= result"cutbrush.png"
	tv_saveMode "PNG"
	tv_AlphaSaveMode "NoPreMultiply"
	tv_SaveDisplay  myFile
tv_LoadBrush myFile

I want to make a custombrush and cut display

Re: tv_saveDisplay with alpha

Posted: 06 Sep 2013, 15:47
by Svengali
Sorry, I don't exactly follow your needs... are you trying to create a brush from multiple layers but without background, i.e. clear/alpha areas?

But one possible workaround might be to set tv_BackGround NONE, then merge all visible layers to a new temp layer, then save that layer only , using tv_SaveImage (or simply grab a brush from that layer) and finally delete the new temp layer?

That should give you an image file with alpha intact.

Sven

Re: tv_saveDisplay with alpha

Posted: 06 Sep 2013, 17:18
by Mads Juul
That would be a possibility.
But I was wondering. Why isnt tv_saveDisplay keeping the Alpha channel? I think it should do this.

Re: tv_saveDisplay with alpha

Posted: 06 Sep 2013, 20:08
by Svengali
madsjuul wrote:But I was wondering. Why isnt tv_saveDisplay keeping the Alpha channel? I think it should do this.
I think the logic is that any final representation of the Display image must include pixels assigned the the background color or partially transparent pixels which alpha-blend with the background color. So the resultant RGB image is composed of pixels which are all 100% opaque.

Wikipedia on Alpha compositing

Sven

Re: tv_saveDisplay with alpha

Posted: 07 Sep 2013, 05:09
by Mads Juul
But it surely must be possible? I find it very logical than I want to keep the transparent part of the current display when I save with tv_saveDisplay .
.So if it not possible, I will make it A Feature Request, .
For a last time just to be sure.
Is possible to save an image with tv_saveDisplay where the transparent areas of the current display becomes transparent in the final image file?
for instance with this code

Code: Select all

tv_getPath TEMP
   myFile= result"cutbrush.png"
   tv_saveMode "PNG"
   tv_AlphaSaveMode "NoPreMultiply"
   tv_SaveDisplay  myFile
tv_LoadBrush myFile
? Mads