Page 1 of 1

Loose background trasparency of a PNG

Posted: Sun Mar 29, 2020 7:22 am
by Sintek
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!!!

Re: Loose background trasparency of a PNG

Posted: Sun Mar 29, 2020 10:37 am
by Sadler
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 256 times

Re: Loose background trasparency of a PNG

Posted: Sun Mar 29, 2020 9:48 pm
by Sintek
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

Re: Loose background trasparency of a PNG

Posted: Sun Mar 29, 2020 9:55 pm
by Sintek
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?

Re: Loose background trasparency of a PNG

Posted: Mon Mar 30, 2020 1:38 pm
by Terry Payman
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.

Re: Loose background trasparency of a PNG

Posted: Mon Mar 30, 2020 8:22 pm
by Sintek
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

Re: Loose background trasparency of a PNG

Posted: Mon Mar 30, 2020 8:26 pm
by Sintek
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!!! :)

Re: Loose background trasparency of a PNG

Posted: Mon Mar 30, 2020 9:31 pm
by Sadler
Any text editor will do. You will see its source when you edit it.

Re: Loose background trasparency of a PNG

Posted: Mon Mar 30, 2020 9:57 pm
by Terry Payman
Brightness__contrast__saturation_XdcXzn_TP.fs
(2.52 KiB) Downloaded 217 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-edit ... s-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

Re: Loose background trasparency of a PNG

Posted: Mon Mar 30, 2020 10:40 pm
by Terry Payman
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 254 times