jdevp11 Posted June 19, 2006 Share Posted June 19, 2006 I’m very curious how the layers blending engine works in Paint.NET. If I have 10 layers that all use non-normal blend operators and if I change one bottom layer with a different blending operator, all the layers above need to be recalculated and rendered again. Is it how it works ? How can layers see through each other if they are blended using non-normal blending operators but with 100% opacity ? Should two non-transparent layers are blended, the result becomes a non-transparent layer ? Jay Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted June 21, 2006 Share Posted June 21, 2006 Moved to General Discussion (The Coding/Development forum is for coding and development related questions, not general "how does this work" stuff.) Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Rick Brewster Posted June 21, 2006 Share Posted June 21, 2006 We use a 32-bit pixel model, BGRA. Blue, green, red, alpha. The alpha component specifies how transparent a pixel is, or rather, how much that pixel contributes to the composition. A pixel with an alpha value of 0 is essentially a pixel that does not exist, and therefore it follows that it would make no contribution to the rendering at that stage, and thus everything below it would "see through" regardless of the blending modes. Since any new layer is initialized such that every pixel has an alpha of 0, it thus follows that all new layers are completely transparent regardless of blending mode. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
jdevp11 Posted June 21, 2006 Author Share Posted June 21, 2006 Thanks Rick. I understand that each new layer added is transparent so that layers below can be seen through. However, when you create a layer by duplicating a background with 255 opacity but non-normal blending, I do not understand how the layers below can be seen through unless the blending occurs when the layers are being rendered. In that is case, layers are no seen through. But since the blending occurs for each layer during rendering , the top layer reflects the layers below. If that is case, how can you manage to get the pretty good performance since if you have 10 layers, each layer needs to be blended with the layer below while it is being rendered? Is this how it works? For ( each layer in layer list) { Render layer using blend op with layer below } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.