Previous topicNext topic

Loose background trasparency of a PNG

Questions, comments, feedback, etc.
Post Reply
Sintek
Posts: 41
Joined: Sat Mar 17, 2018 1:55 pm

Loose background trasparency of a PNG

Post 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!!!
Sadler
Posts: 1139
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Loose background trasparency of a PNG

Post 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
Sintek
Posts: 41
Joined: Sat Mar 17, 2018 1:55 pm

Re: Loose background trasparency of a PNG

Post 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
Sintek
Posts: 41
Joined: Sat Mar 17, 2018 1:55 pm

Re: Loose background trasparency of a PNG

Post 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?
Terry Payman
Posts: 710
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Loose background trasparency of a PNG

Post 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.
Sintek
Posts: 41
Joined: Sat Mar 17, 2018 1:55 pm

Re: Loose background trasparency of a PNG

Post 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
Sintek
Posts: 41
Joined: Sat Mar 17, 2018 1:55 pm

Re: Loose background trasparency of a PNG

Post 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!!! :)
Sadler
Posts: 1139
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Loose background trasparency of a PNG

Post by Sadler »

Any text editor will do. You will see its source when you edit it.
Terry Payman
Posts: 710
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Loose background trasparency of a PNG

Post 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
Terry Payman
Posts: 710
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Loose background trasparency of a PNG

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