lightknight Posted June 16, 2022 Share Posted June 16, 2022 I am working on a Reverse Opacity plugin. I've bought the book on Paint.Net (still reading it), and I am posting just to verify -> Paint.Net does all of its blending in RGB mode, right? Quote Link to comment Share on other sites More sharing options...
Solution Rick Brewster Posted June 16, 2022 Solution Share Posted June 16, 2022 Paint.NET uses 32-bits per pixel (8-bits per component) BGRA in straight alpha (not premultiplied alpha). 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...
lightknight Posted July 6, 2022 Author Share Posted July 6, 2022 Sorry to bother you again, but I was wondering if you could point me in the direction of some resources for / fill me in on HSV blending. Paint.Net seems to support HsvColors, albeit as a second class citizen, and I've found that reversing opacity through HSV (as an option) gives interesting, possibly better results, if the original image had been made in an application whose primary color space was HSV. Additionally, should I support CMYK reverse opacity as well? Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted July 6, 2022 Share Posted July 6, 2022 The upcoming update, v4.4, will actually make working with HSV a lot easier. Effects will be able to use Direct2D, including its robust imaging/effects system. There are effects built-in to Direct2D that handle conversion to and from RGB and HSV/HSL. See here and here. And you get full 32-bit floating-point precision per component. On top of that you can write pixel shaders to create your own Direct2D effects that you combine with other Direct2D effects. I don't really know anything about blending in HSV though. I would probably convert to RGB and do the blending there, although obviously the precision afforded by integers in the current release of PDN are not too friendly for that. 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...
lightknight Posted July 6, 2022 Author Share Posted July 6, 2022 Indeed. There are some things which trouble me about HSV: Colors approaching white all feature low saturation. But what is the equation that is used to desaturate a color when approaching white? To reverse this, I would need to add saturation to a color. And how should hue be calculated, if it's based off of a 360 degree circle? If I have a hue at 0 and 180 degrees, which halfway point (90 degrees or 270 degrees) is correct? Should I use RGB blending for hints here? Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted July 6, 2022 Share Posted July 6, 2022 I do not know the answers to these questions. I am not an expert on HSV/HLS Also, it really depends on what you're trying to accomplish. I suspect that "blending" isn't something you can really do in HSV/HLS color space, at least for Hue, because the coordinate system loops back on itself. I think that's called a closed coordinate system. For any two coordinates that are 180 degrees apart, there are two answers for "what's the halfway point?" Trying to take a simple average, (a+b)/2 will give obviously wrong results in may cases, especially for 0 and 180, or even 1 and 359. But, I don't know. I would just go spelunking in Google to see what you can find out. 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...
Reptillian Posted July 6, 2022 Share Posted July 6, 2022 1 hour ago, Rick Brewster said: I suspect that "blending" isn't something you can really do in HSV/HLS color space, at least for Hue, because the coordinate system loops back on itself. Applying blending modes isn't dependent on color space. You can use blending modes within any color space. You do have a point that HS* are a closed system, but that can be addressed by taking that into account. It's just not easy to do it at times, and this is why no one bothers (including myself, and I take the easy way out when doing this). HSV blending can be resolved by operating on another color space like YUV/YIQ/YCbCr, and the result can be close enough. 2 Quote G'MIC Filter Developer 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.