tv_saveDisplay with alpha

Please use this part to report bugs & errors, ask questions & "How to..."
Post Reply
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

tv_saveDisplay with alpha

Post 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
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: tv_saveDisplay with alpha

Post 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
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: tv_saveDisplay with alpha

Post 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.
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: tv_saveDisplay with alpha

Post 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
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: tv_saveDisplay with alpha

Post 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
Post Reply