Loose background trasparency of a PNG

Sun Mar 29, 2020 7:22 am

Hello there, as in the subject I noticed that if I put a transparent background .png in the Image module and then apply the contrast module oncreasing the brightness the trasparent background appears as white. How should I avoid that? Thanks and have a pretty nice day!!!
Sintek
 
Posts: 36
Joined: Sat Mar 17, 2018 1:55 pm

Re: Loose background trasparency of a PNG

Sun Mar 29, 2020 10:37 am

Most modules are fine but there's few shaders that could do with an option to respect alpha.

Try this instead...
Brightness__contrast__saturation_XdcXzn.fs
(2.2 KiB) Downloaded 39 times
Sadler
 
Posts: 686
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Loose background trasparency of a PNG

Sun Mar 29, 2020 9:48 pm

Sadler wrote:Most modules are fine but there's few shaders that could do with an option to respect alpha.

Try this instead...
Brightness__contrast__saturation_XdcXzn.fs


Thabk you so much!!! Tomorrow I'll try it out!! :D
Sintek
 
Posts: 36
Joined: Sat Mar 17, 2018 1:55 pm

Re: Loose background trasparency of a PNG

Sun Mar 29, 2020 9:55 pm

Sadler wrote:Most modules are fine but there's few shaders that could do with an option to respect alpha.

Try this instead...
Brightness__contrast__saturation_XdcXzn.fs


Anyway where you have found that shader?
Sintek
 
Posts: 36
Joined: Sat Mar 17, 2018 1:55 pm

Re: Loose background trasparency of a PNG

Mon Mar 30, 2020 1:38 pm

Thanks Sadler!
I hadn't been conscious of how much hassle I've had over the years using brightness and contrast adjustment modules which never seemed to do quite what I wanted.

This one is much better, and with a small mod does exactly what I want when adjusting contrast. I didn't like the output going to grey when I set Contrast = 0.0, so without really understanding why it's there I "disabled" line 57 float t = ( 1.0 - contrast ) / 2.0; by inserting t = 0; on a line afterwards.

EDIT: My intuition is based on my electronic and video engineering background. I think of contrast adjustment as being a gain control. Zero gain gives "no output", and "no output" is black not grey.
Terry Payman
 
Posts: 566
Joined: Sun Sep 14, 2014 8:15 am
Location: UK

Re: Loose background trasparency of a PNG

Mon Mar 30, 2020 8:22 pm

Sadler wrote:Most modules are fine but there's few shaders that could do with an option to respect alpha.

Try this instead...
Brightness__contrast__saturation_XdcXzn.fs


It works amazing!!!! Thank you so much!!! :D
Sintek
 
Posts: 36
Joined: Sat Mar 17, 2018 1:55 pm

Re: Loose background trasparency of a PNG

Mon Mar 30, 2020 8:26 pm

Terry Payman wrote:Thanks Sadler!
I hadn't been conscious of how much hassle I've had over the years using brightness and contrast adjustment modules which never seemed to do quite what I wanted.

This one is much better, and with a small mod does exactly what I want when adjusting contrast. I didn't like the output going to grey when I set Contrast = 0.0, so without really understanding why it's there I "disabled" line 57 float t = ( 1.0 - contrast ) / 2.0; by inserting t = 0; on a line afterwards.

EDIT: My intuition is based on my electronic and video engineering background. I think of contrast adjustment as being a gain control. Zero gain gives "no output", and "no output" is black not grey.


I'm pretty curious now!!! Can I edit that ISF with TextEdit for Mac or it needs something more appropriate? And, can you (please forgive me) be more accurate pasting the indicted rows?

Thanks, would be much appreciated!!! :)
Sintek
 
Posts: 36
Joined: Sat Mar 17, 2018 1:55 pm

Re: Loose background trasparency of a PNG

Mon Mar 30, 2020 9:31 pm

Any text editor will do. You will see its source when you edit it.
Sadler
 
Posts: 686
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Loose background trasparency of a PNG

Mon Mar 30, 2020 9:57 pm

Brightness__contrast__saturation_XdcXzn_TP.fs
(2.52 KiB) Downloaded 36 times
For anything other than minor changes it's extremely useful to be able to check the syntax of the file too. A specialised editing environment will show you the location of any syntax error that stops the ISF compiling. If it doesn't compile it will do nothing at all!

My favourite ISF editing environment is created by Vidvox, the creators of the ISF format. I think there may be a Mac-only version, but I've been using the cross-platform beta version, which I find invaluable. Read about it here https://discourse.vidvox.net/t/isf-editor-for-windows-beta/647

That has a link to the latest installers on GitHub, https://github.com/mrRay/VVISF-GL/releases
Under "Latest Release Builds", expand the "Assets" and you should find the latest version, currently ISFEditor_installer_2.9.13.app.zip

I'm happy to help if it's not clear how to use the editor - it's a hugely productive tool and will greatly facilitate the use and modification of ISF shaders. It can import many shaders from Shadertoy, and it's easy to add extra parameters.

FWIW here's my modded version. Further to my previous comments, it has the advantage that blacks are not crushed when contrast is increased.
Please note that, with its origin on Shadertoy and with Shadertoy's default permissions, this ISF is not for commercial use.
The attachment Brightness__contrast__saturation_XdcXzn_TP.fs is no longer available
Terry Payman
 
Posts: 566
Joined: Sun Sep 14, 2014 8:15 am
Location: UK

Re: Loose background trasparency of a PNG

Mon Mar 30, 2020 10:40 pm

My internet access to the Magic site is exceptionally slow and unresponsive. Here's another attempt at uploading my modded ISF.
Brightness__contrast__saturation_XdcXzn_TP.fs
(2.52 KiB) Downloaded 40 times
Terry Payman
 
Posts: 566
Joined: Sun Sep 14, 2014 8:15 am
Location: UK

Return to General Discussion

© 2020 Color & Music, LLC • This web site is mobile-friendly