Too close to the RC release date… so this is going to have to go into the 8.x branch… Which means 8.22 is where you’ll see the fix… The next V9 WIP will have it in there though.
This isn’t Rhino doing this…it’s the MSAA (antialiasing) along edge boundaries that’s doing this. Mainly because you’re trying to capture AA’d results at a very, very low resolution, where pixels are rare.
The reason you’re getting gray is because one of the colors is made up of 2 of the primary colors (red and blue) RGB(1, 0, 1)… and the other color is made up of the 3rd primary color Green RGB(0, 1, 0). So when AA kicks in along those edges, it starts sampling and blending the surrounding colors…and some of those samples end up being 50% of color 1 and 50% of color 2… which means you get RGB(0.5, 0.0, 0.5) and RGB(0.0, 0.5, 0.0) … and when you add those two together, you get RGB(0.5, 0.5, 0.5) … i.e. Gray…and you’re also going to get variations therein… i.e. gradations
Here’s a screenshot of Rhino’s viewport zoomed out so that only a few pixels are used (note: I’ve zoomed into the screenshot in order to better show the results).
I’ve also then taken a screenshot at high resolution and then zoomed into it… The effect isn’t as noticeable since there are so many pixels, but the same issue is there…
You’re using very, very low resolutions to capture AA’d output.
You’re using colors that don’t really blend very well together, since they’re made up of all 3 pure primary colors.
There’s really nothing that I can think of to prevent this…especially since the AA is getting done by the drivers.
That being said, what you could try is to output your “parts” separately…at least the parts that share or have adjacent edges, and then blend and merge the two. However, you’re still going to get gray pixels somewhere along the boundaries simply because of the two colors you’re using… It’s just color arithmetic.. Magenta + Green = White … and any equal variations of those two colors is going to produce gradations of white/gray.
Here’s what I tried…
I hid the pink portion and ran your script.
I unhid the pink portion and hid the green and white portions and ran your script.
I then merged the two results in an image processor.
The final result is better than what you get doing it all at once, but again, you’re still going to get gray pixels (or close to gray) due to the two colors you’re using.
And just to drive my point home here… I’ve captured only the green and white portions and then brought them into Photoshop on a separate layer. I then created a background layer and made it Magenta. As you can see, there are still variations of gray pixels that result in the two colors being blended. It’s better, but it still produces gradations of gray…It’s just how things work.
If you don’t want varying shades of gray in your AA’d results, then don’t use all three primary colors when (combined) with portions that will be adjacent with each other. Sorry, that’s all I can recommend atm.
thank you very much for your time, and your detailed look at my problem.
I didn’t realize that green and magenta mix to gray. You are right, to avoid this, I should reduce the Antialiasing (e.g. from 4x to 2x or none) between these colors in my lowres images.