I have a problem. And it will be a great help to me if you have a solution.Thanks a lot!I need to render a image of a model, and I need every pixel of the model the single color. I want to render a image using Cycles engine and GPU Compute(these two are necessary). In Material, I set the model surface type "Emission" and a single color(e.g.RGB(255, 0, 0)),and in Render-Film, I set the Gaussian Width is 0.01(it can not be set 0). Then I render the image. Almost each pixel is (255,0,0),but there is still several pixels whose color are different. enter image description here enter image description here

We can see when we enlarge the picture, some pixel's color is not the setting color(255,0,0). I need to calculate the pixels of setting color accurately, so I need every pixel is the setting color. I am new about the blender. And is there any solution to my target? Thanks.


If it is an identification of the rendered part you want (where every object has its own colour), use the ID render pass. In the object properties, set the "Pass Index" to a unique number. In the Render Layer properties, enable the Object Index pass.

Object and Render Layer properties

Then use the IndexOB slot of the Render Layer node to render the colours. For each pixel, this slot will give you the value of the "Pass Index" property you set on the object. You can use a ColorRamp node to map from a number to a colour; however, that accepts only numbers between 0 and 1, so you have to divide the IndexOB by the highest number you used. In my example the background has index 0, the cube has index 1, and the sphere has index 2, so I divide by 2.

Node setup and result


Use Compositor

Just render all object on transparent layer (enable Transparent in Film settings)

Alpha Convert node reveals all alpha, but for better control run Alpha pass through Math node. Its value defines threshold for alpha (as you can see two pixels were thrown out on the right)

enter image description here

P.S. As you have also mentioned Blender Render in tags: for this engine simply turn off AntiAliasing in render settings and that's it, no need in compositing.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.