Jump to content
How to Install Plugins ×

Paneling Effect Plugin (ymd:100718)


MadJik

Recommended Posts

...PixD.R = (byte)((float)(Pix1.R + Pix2.R + 0.5f)/2.0f);...

What does adding 0.5f do? It seems that this kinda makes the results a little brighter, is that right? Thats why I initially thought of Lighten.

 

Take responsibility for your own intelligence. 😉 -Rick Brewster

Link to comment
Share on other sites

...PixD.R = (byte)((float)(Pix1.R + Pix2.R + 0.5f)/2.0f);...

What does adding 0.5f do? It seems that this kinda makes the results a little brighter, is that right? Thats why I initially thought of Lighten.

 

Take responsibility for your own intelligence. 😉 -Rick Brewster

Link to comment
Share on other sites

...PixD.R = (byte)((float)(Pix1.R + Pix2.R + 0.5f)/2.0f);...

What does adding 0.5f do? It seems that this kinda makes the results a little brighter, is that right? Thats why I initially thought of Lighten.

...initialy for rounding!

(3 + 2) / 2 = 2.5 ; integer is 2

(3 + 2 + 0.5) / 2 = 2.75 ; integer is 2

Conclusion: It's useless! (wrong formula!)

It's should be:

(3 + 2) / 2 + 0.5 = 2.5 + 0.5 = 3.0 ; integer =3;

(2 + 2) / 2 + 0.5 = 2.0 + 0.5 = 2.5 ; integer =2;

Link to comment
Share on other sites

...PixD.R = (byte)((float)(Pix1.R + Pix2.R + 0.5f)/2.0f);...

What does adding 0.5f do? It seems that this kinda makes the results a little brighter, is that right? Thats why I initially thought of Lighten.

...initialy for rounding!

(3 + 2) / 2 = 2.5 ; integer is 2

(3 + 2 + 0.5) / 2 = 2.75 ; integer is 2

Conclusion: It's useless! (wrong formula!)

It's should be:

(3 + 2) / 2 + 0.5 = 2.5 + 0.5 = 3.0 ; integer =3;

(2 + 2) / 2 + 0.5 = 2.0 + 0.5 = 2.5 ; integer =2;

Link to comment
Share on other sites

MadJik, I just realized that your code, w/ your average setting, is the same as:

1. duplicating your image.

2. runny BB's helper on top layer.

3. setting top layer opacity to 50%.

Would it be easier to code this by duplicating the source, running the helper effect and the altering the opacity?

 

Take responsibility for your own intelligence. 😉 -Rick Brewster

Link to comment
Share on other sites

MadJik, I just realized that your code, w/ your average setting, is the same as:

1. duplicating your image.

2. runny BB's helper on top layer.

3. setting top layer opacity to 50%.

Would it be easier to code this by duplicating the source, running the helper effect and the altering the opacity?

I think it's already the way it works pixel per pixel!

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 3 months later...
  • 4 months later...
  • 2 months later...
  • 6 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...